Gene Presentation For Android

42
Android+Amzonca+Zxing=? By Gene Leybzon http://www.facebook.com/profile.php?id=574038581

description

Android Platform/Android development process presentation at Stanford Open Source

Transcript of Gene Presentation For Android

Page 1: Gene Presentation For Android

Android+Amzonca+Zxing=?

By Gene Leybzon

http://www.facebook.com/profile.php?id=574038581

Page 2: Gene Presentation For Android
Page 3: Gene Presentation For Android

Android

Android is the first free, open source, and fully

Android is the first free, open source, and fully and fully customizable mobile platform.

and fully customizable mobile platform.

Page 4: Gene Presentation For Android

Android Platform

ApplicationsApplications

Application FrameworkApplication Framework

LibrariesLibrariesLibrariesLibraries

Linux KernelLinux Kernel

Mobile Device(s)Mobile Device(s)

Page 5: Gene Presentation For Android

Android Applications

PhonePhone

BrowserBrowser

ContactsContactsContactsContacts

SMSSMS

User Developed ApplicationsUser Developed Applications

Page 6: Gene Presentation For Android

Android Application Framework

Activity ManagerActivity Manager

Window ManagerWindow Manager

Telephony ManagerTelephony ManagerTelephony ManagerTelephony Manager

Location ManagerLocation Manager

Notification ManagerNotification Manager

Page 7: Gene Presentation For Android

Android Libraries

Open GLOpen GL

SSLSSL

WebKitWebKit

SQL LiteSQL Lite

Page 8: Gene Presentation For Android

Android Linux Kernel

Linux version 2.6Linux version 2.6

NetworkNetwork

SecuritySecurity

Memory…Memory…

Page 9: Gene Presentation For Android

Android Mobile Devices

Page 10: Gene Presentation For Android

Future of Android

Q4 2008: Localization (German)Q4 2008: Localization (German)

Q4 2008: Support for multiple access point nodesQ4 2008: Support for multiple access point nodes

Q1 2009: Input method Q1 2009: Input method Q1 2009: Input method frameworkQ1 2009: Input method framework

Q1 2009: Input method enginesQ1 2009: Input method engines

Q1 2009: Localization(French, Italian, es_es, zh_TW, Ja, NL, CZ)Q1 2009: Localization(French, Italian, es_es, zh_TW, Ja, NL, CZ)

Page 11: Gene Presentation For Android

Deep Dive

Into Android

Application Application

Development

Page 12: Gene Presentation For Android

Development Process OverviewDownload/Install SDK

http://code.google.com/android/download.html

Download/Install SDK

http://code.google.com/android/download.html

Install Eclipse IDE 3.3

http://www.eclipse.org/downloads/

Install Eclipse IDE 3.3

http://www.eclipse.org/downloads/

Develop the applicationDevelop the applicationDevelop the applicationDevelop the application

Sign the appSign the app

Debug & TestDebug & Test

Publish to marketplacePublish to marketplace

Page 13: Gene Presentation For Android

Developing Applications

Remember your goalRemember your goal

Know building blocks *Know building blocks *

Know JavaKnow JavaKnow JavaKnow Java

Know the process *Know the process *

Be creativeBe creative

Page 14: Gene Presentation For Android

Building Blocks

Android ManifestAndroid Manifest

ActivityActivity

ViewView

Intent and Intent FiltersIntent and Intent FiltersIntent and Intent FiltersIntent and Intent Filters

ServicesServices

NotificationsNotifications

Content ProvidersContent Providers

Page 15: Gene Presentation For Android

Android Manifest

Is an XML fileIs an XML file

Application propertiesApplication properties

ActivityActivity

PermissionsPermissions

InstrumentationInstrumentation

Intent and Intent FiltersIntent and Intent Filters

ReceiverReceiver

ServiceService

Content ProviderContent Provider

Page 16: Gene Presentation For Android

android.app.Activity

Object that has lifecycleObject that has lifecycle

May or may not have interact

with end-user

May or may not have interact

with end-user

Have stateHave state

Can save persistent stateCan save persistent state

Can be foreground or backgroundCan be foreground or background

Page 17: Gene Presentation For Android

Activity Lifecycle

Page 18: Gene Presentation For Android

android.view.View

Basic UI building blockBasic UI building block

Responsible for drawing UIResponsible for drawing UIResponsible for drawing UIResponsible for drawing UI

Process Events (key, trackball, touch)Process Events (key, trackball, touch)

Page 19: Gene Presentation For Android

android.content.Intent

Describes operation to be performedDescribes operation to be performed

Is a glue between activitiesIs a glue between activitiesIs a glue between activitiesIs a glue between activities

Describes desired action and data necessary to perform the actionDescribes desired action and data necessary to perform the action

Page 20: Gene Presentation For Android

Intent Actions

MAINMAIN

VIEWVIEW

PICKPICK

EDITEDIT

Page 21: Gene Presentation For Android

android.content.IntentFilter

Describes capabilitiesDescribes capabilities

Used for intent resolutionUsed for intent resolutionUsed for intent resolutionUsed for intent resolution

Describes how to handle actionDescribes how to handle action

Page 22: Gene Presentation For Android

android.content.BroadcastReceiver

Handles external eventsHandles external events

Used for both sending and receiving broadcasts Used for both sending and receiving broadcasts broadcasts broadcasts

Described in app manifestDescribed in app manifest

Page 23: Gene Presentation For Android

android.app.Service

Runs in the backgroundRuns in the background

Does not interact with usersDoes not interact with usersDoes not interact with usersDoes not interact with users

Declared in app manifestDeclared in app manifest

Page 24: Gene Presentation For Android

Content Providers

Object that can store and retrieve data Object that can store and retrieve data

Accessible by other applications Accessible by other applications Accessible by other applications Accessible by other applications

Many content providers are pre-build by Android (Audio, Video, Contacts)Many content providers are pre-build by Android (Audio, Video, Contacts)

Page 25: Gene Presentation For Android

Notifications

Icon in the status barIcon in the status bar

Flashing LED Flashing LED

SoundSound

VibrationVibration

Page 26: Gene Presentation For Android

UI Components (demo time)

Page 27: Gene Presentation For Android

Practical App Example

Amazonca Barcode Reader

Page 28: Gene Presentation For Android

Amazonca.com

Page 29: Gene Presentation For Android

AMAZONCA.COM

Page 30: Gene Presentation For Android

AMAZONCA.COM

Barcode Database (1 Mil records)Barcode Database (1 Mil records)

APIAPI

Creative Commons LicenseCreative Commons License

Social FeaturesSocial Features

Page 31: Gene Presentation For Android

ZXing (“Zebra Crossing”)

Page 32: Gene Presentation For Android

ZXing

Barcode Decoding LibraryBarcode Decoding Library

JavaJava

Apache License 2.0Apache License 2.0

UPC-A ,UPC-E, EAN-8, EAN-13 decodingUPC-A ,UPC-E, EAN-8, EAN-13 decoding

Page 33: Gene Presentation For Android

Android + ZXing+

Android

Mobile Barcode

ZXing

Barcode Reader

Page 34: Gene Presentation For Android

Android + ZXing+

Android

Mobile Barcode

ZXing

Barcode Reader

Page 35: Gene Presentation For Android

Android + Zxing + Amazonca+

Android

Physical World to

+

ZXing

Amazonca.com

World to WEB

Connection

Page 36: Gene Presentation For Android

Behind the + sign (location)+ +

android.content.Context c = mActivity .getApplicationContext();

android.location.LocationManager lm = (LocationManager);

c.getSystemService(Context.LOCATION_SERVICE);c.getSystemService(Context.LOCATION_SERVICE);

Location loc =

lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);

Double lat = loc.getLatitude();

Double lon = loc.getLongitude();

String s = "lat="+ lat.toString() + "&lon=" + lon.toString();

Page 37: Gene Presentation For Android

Demo Time

Page 38: Gene Presentation For Android

∑ummary+ +

Open source is mash-able

Fastest way to build a product –

maximum reuse of existing components

Pay attention to licensing:Pay attention to licensing:Android - Apache Software License

ZXing - Apache Software License

Amazonca .com data - Creative Commons 3.0

Page 39: Gene Presentation For Android

Gene Leybzon

Page 40: Gene Presentation For Android

http://code.google.com/android/

Page 41: Gene Presentation For Android

http://code.google.com/p/zxing/

Page 42: Gene Presentation For Android

http://www.amazonca.com