58
Welcome... to G oogle IO 11; ooops... sorry, GTUG welcomes you to the Android launch Friday, May 6, 2011

Android Development Slides

Embed Size (px)

DESCRIPTION

These are slides that accompanied a talk on Android application development.

Citation preview

Page 1: Android Development Slides

Welcome... to Google IO 11; ooops...sorry,

GTUG welcomes you to the Android launch

Friday, May 6, 2011

Page 2: Android Development Slides

Location: San Francisco, California

Friday, May 6, 2011

Page 3: Android Development Slides

nah!! just Kidding...

Friday, May 6, 2011

Page 4: Android Development Slides

Google Uganda - Android Developer LaunchKampala, Uganda

May, 2011

Friday, May 6, 2011

Page 5: Android Development Slides

Victor Miclovich, Android developer + enthusiast

twitter:@vicmiclovich

http://cwezi.com

http://mspoti.com

http://storyspaces.org

http://thekuyuproject.org

Android Awesomeness

Friday, May 6, 2011

Page 6: Android Development Slides

Introducing Android Devices

Fun and Easy to use

communication on the go

Online

You won’t get lost

You can get rid of keys

Friday, May 6, 2011

Page 7: Android Development Slides

Fun and Easy to useCool graphics

lots of power under the hood for gaming

Friday, May 6, 2011

Page 8: Android Development Slides

Key-lessnesslose the key pad... new devices designed to be touch-

screen compatible; Android takes it a notch higher: multitouch

Friday, May 6, 2011

Page 9: Android Development Slides

CommunicationGmail

And obviously:Web browser,

Basic BT,etc.

Friday, May 6, 2011

Page 10: Android Development Slides

Online connectivity...

Android OS is designed to enable device connectivity to the networked world

Friday, May 6, 2011

Page 11: Android Development Slides

A-O-B

Lots of power under the hood >>> in comes “App development”

very true... Android OS lays out hardware requirements and conditions that phone manufacturers should follow in order to have well optimized operations

Friday, May 6, 2011

Page 12: Android Development Slides

Application Development$> Assumptions

$> Framework

$> Piecing the UI together

$> Basic networking

$> Services (RESTful web service intro)

Friday, May 6, 2011

Page 13: Android Development Slides

Assumptions

You’ve read the handout or have it close by to guide you...

Friday, May 6, 2011

Page 14: Android Development Slides

About Android }-*->F-work

Friday, May 6, 2011

Page 15: Android Development Slides

What is a mobile app?

a set of user interfaces arranged to form a pattern

these patterns tend to accomplish tasks!!!

Friday, May 6, 2011

Page 16: Android Development Slides

How to design an app?

Start with an idea

Research the idea (ask around: UCD)

Concept it (use storyboards, write! write!)

Prototype it

Start coding

Iterate (repeat step 1 or 2)

Friday, May 6, 2011

Page 17: Android Development Slides

Isn’t that easy?

Friday, May 6, 2011

Page 18: Android Development Slides

How??????

how?

Friday, May 6, 2011

Page 19: Android Development Slides

Android UIs

2 ways of working magic with apps-->>

Friday, May 6, 2011

Page 20: Android Development Slides

One way is...

through a declarative approach...

Friday, May 6, 2011

Page 21: Android Development Slides

Declarative user interface<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/splash" /></LinearLayout>

Friday, May 6, 2011

Page 22: Android Development Slides

another way is to...

use a programmatic approach...

Google advises programmers to choose option 1)why?

->It is cleaner + keeps your code easy to maintain->In case you make app changes, it is easy to do

examples:*swing*gwt

Friday, May 6, 2011

Page 23: Android Development Slides

what to do?

You’ll use both approaches

Declarative approach to describe how something looks or appears such what a button should look like

Programmatic approach to give life to the UI component such as a button

Friday, May 6, 2011

Page 24: Android Development Slides

user interface design...

Friday, May 6, 2011

Page 25: Android Development Slides

Android UID

Views

Layouts

Friday, May 6, 2011

Page 26: Android Development Slides

Views

Everything you see through your screen is a view

Friday, May 6, 2011

Page 27: Android Development Slides

Examples of Views

TextView (text)

ButtonView (buttons)

ListView (lists)

EditView (text boxes)

ImageView (image)

MapView (to view maps)

WebView (embedded web + webkit rendering)

Friday, May 6, 2011

Page 28: Android Development Slides

Layouts

Organize views

group view components together

Friday, May 6, 2011

Page 29: Android Development Slides

Examples Layouts

LinearLayouts

TableLayouts

FrameLayout

RelativeLayout

AbsoluteLayout (using (x,y) coord. system)

Friday, May 6, 2011

Page 30: Android Development Slides

Notes

Layouts are resizable (expand with content)

expand with the different device sizes (better graphics rendering that supports)

Layouts are customizable

Friday, May 6, 2011

Page 31: Android Development Slides

What else in Android?

Services that will run in the background

Intents and broadcasting (that support in-app notification and instructions)

lots of crazy cool stuff... just need to dig deeper than 45 minutes! lol!

Friday, May 6, 2011

Page 32: Android Development Slides

Prerequisites

Java programming

Read the handout

watch out for things like the application life cycle, etc.

Ask questions at the end

Friday, May 6, 2011

Page 33: Android Development Slides

Code

Friday, May 6, 2011

Page 34: Android Development Slides

Layout parameters

Specify the way layouts appear

Basically in your xml files:

android:layout_height = “ <some height>”

android:layout_width = “ <some width>”

Friday, May 6, 2011

Page 35: Android Development Slides

¿Tip!

When looking thru’ documentation, start with the specific less abstract view/class or layout then look at what it inherits from parent class

Friday, May 6, 2011

Page 36: Android Development Slides

App components (java classes)

Activities

BroadcastReceivers

Services

ContentProviders

analogous to a screen

respond to broadcast intents/msgs

tasks that run in the background

apps can share data

Friday, May 6, 2011

Page 37: Android Development Slides

Activities

Friday, May 6, 2011

Page 38: Android Development Slides

an activity (-ies)

a UI screen or what appears before the user as whole

An Activity is also a java class

Activities can also be

faceless

in a floating window

just return a value (boolean or other)

Friday, May 6, 2011

Page 39: Android Development Slides

Intents

Friday, May 6, 2011

Page 40: Android Development Slides

Intents

Intents help describe what you want done (verb words + objects)

Pick photo from album

Delete music

Make a call

Android matches Intent with Activity (object) that can best provide a service

Friday, May 6, 2011

Page 41: Android Development Slides

Note

Activities and BroadcastReceivers describe what intents they can service in their IntentFilters through the

AndroidManifest.xml file

Friday, May 6, 2011

Page 42: Android Development Slides

BroadcastReceivers

Friday, May 6, 2011

Page 43: Android Development Slides

BroadcastReceivers

components designed to respond to Broadcast Intents

also, apps can create and broadcast their own Intents as well.

Friday, May 6, 2011

Page 44: Android Development Slides

Servers

Friday, May 6, 2011

Page 45: Android Development Slides

Services

These are components that run in the background...

A music player keeps running even when you choose to start looking through your gallery

You can type a message while listening to music

Download a pdf while browsing Youtube

etc.

Friday, May 6, 2011

Page 46: Android Development Slides

ContentProviders

Friday, May 6, 2011

Page 47: Android Development Slides

ContentProviders

A ContentProvider enables sharing of data across different apps

some apps can poll the address book

an app could use your gallery photos, etc.

Provides a single unified API for

CRUD operations

Content is represented by a URI and MIME type

Friday, May 6, 2011

Page 48: Android Development Slides

Other issues of great importance...

Friday, May 6, 2011

Page 49: Android Development Slides

Persisting data

Some apps need to cache or store data inside of the phone (email, messages, attachments via bluetooth, etc.)

Android provides a couple of ways to store your data

as a flat file

in a database (SQLite)

Friday, May 6, 2011

Page 50: Android Development Slides

Note

There are lots of useful APIs to interact with the database, file system, etc.

Android is powerful and quite large

Look around to see what you can do with it...

Friday, May 6, 2011

Page 51: Android Development Slides

Going forward...

Friday, May 6, 2011

Page 52: Android Development Slides

Packaging

Android apps are packaged in .apk files

Everything needed to run your app is found in the apk

It also includes your application manifest file (where permissions for activities and other predefined settings are saved up) {look at handout for more info in app}

Friday, May 6, 2011

Page 53: Android Development Slides

Resources

Android defines resources an app uses in the res/ folderres/layout (contains layout rules)

res/drawable (for drawing)

res/anim (for animations your app might need)

res/values (externalized values for strings, colors, styles and lots more)

res/xml (general xml files that are needed at run time such as a settings.xml file, etc.)

res/raw (binary files like sound are defined in there)

Friday, May 6, 2011

Page 54: Android Development Slides

Assets

Friday, May 6, 2011

Page 55: Android Development Slides

Assets

A lot similar to resources (from slides before)

Any kind of file can be stored (make sure it doesn’t complete the SD card memory or other)

Differences are:

assets are read only

InputStream class (methods) access assets

Friday, May 6, 2011

Page 56: Android Development Slides

The Networked world...

Friday, May 6, 2011

Page 57: Android Development Slides

so much to say...

Trending way of development

use an API to expose a service your mobile app can use

Your app can persist data in a database if network is unavailable

Apps are so much fun when connected to the Internet

Friday, May 6, 2011

Page 58: Android Development Slides

The End...More might come in the future,

http://cwezi.com/trainings (coming soon)

vicmiclovich{at}gmail.com

Friday, May 6, 2011