36
 Rich Web Experience 2010 Android Development... The 20,000-Foot View

Android Development...The 20,000-Foot View

Embed Size (px)

DESCRIPTION

from the Rich Web Experience 2010 conference, a high-level overview of Android application development

Citation preview

Page 1: Android Development...The 20,000-Foot View

   

Rich Web Experience 2010

Android Development...The 20,000­Foot View

Page 2: Android Development...The 20,000-Foot View

   

Welcome to Android!

● High Momentum– Today: smartphones– Tomorrow: tablets and televisions– Later: cars? toasters? cars that make toast?!?

Page 3: Android Development...The 20,000-Foot View

   

Welcome to Android!

● Opportunities– Retail Distribution (Android Market, etc.)– OEM Distribution– Internal Distribution (enterprise, etc.)– Social Distribution

Page 4: Android Development...The 20,000-Foot View

   

Welcome to Android

● Development Models– Standard Applications

● Java● Web technologies

– Games● 2D (Canvas)● 3D (OpenGL)

Page 5: Android Development...The 20,000-Foot View

   

Basket of Components

● Activity– Primary unit of user interface– Think: screen, page, window– “User transaction”– Design model: lots of cheap activities

Page 6: Android Development...The 20,000-Foot View

   

Basket of Components

● Service– Long-running task (download)– User-controlled background task (music player)– “Cron job” (check for unread email)– Integration point (third-party API)

Page 7: Android Development...The 20,000-Foot View

   

Basket of Components

● Broadcast Receiver– System events (battery low)– Application messages

● Content Provider– Integration point (expose database)– Abstraction layer (expose Web service)

Page 8: Android Development...The 20,000-Foot View

   

Activities and Widgets

● Activities Host Widgets– Widget = micro unit of UI– Organized via layout managers– Described using XML

● Activity as a whole● Portions of an activity (rows in a selection list)

Page 9: Android Development...The 20,000-Foot View

   

Activities and Widgets

● Multiple Layout Flavors– Portrait versus landscape– Normal versus large– Touchscreen versus pointer (trackball)

● Flow = Web-Like– Click to launch new activities– BACK button– HOME button

Page 10: Android Development...The 20,000-Foot View

   

Java and Dalvik

● What You Write– Java– XML– C/C++ (optional)

Page 11: Android Development...The 20,000-Foot View

   

Java and Dalvik

● What Android Runs: Dalvik– Virtual machine, like Perl or Java– Build tools translate your Java code to Dalvik

bytecode– Usually invisible to you

Page 12: Android Development...The 20,000-Foot View

   

Java and Dalvik

● Third-Party Code– Source or JARs– Possible Compatibility Issues

● Assumption of certain Java classes● Assumption of certain platform● Unsupported compiler (1.4.2)

Page 13: Android Development...The 20,000-Foot View

   

Resources

● Non-Java Application Assets– Layouts– Images (PNG, JPEG, etc.)– Audio clips– Strings– Animations– Menus– Etc.

Page 14: Android Development...The 20,000-Foot View

   

Resources

● Resource Sets– Language– Screen density– Screen size– Dozens of other criteria

Page 15: Android Development...The 20,000-Foot View

   

Intents and Integration

● Intents as Message Bus– Start an activity– Start a service– Send a broadcast

Page 16: Android Development...The 20,000-Foot View

   

Intents and Integration

● Use Intents Internally– Start your own activities– Start your own services– Send your own “narrowcasts”

● Service activity or notification→

– Send your own “broadcasts” to third parties

Page 17: Android Development...The 20,000-Foot View

   

Intents and Integration

● Use Intents Externally– Send a message with the user's choice of “send”

application (email? SMS? Twitter? Facebook?)– Offer to view a certain MIME type– Launch an OS-supplied activity (map)– Launch a third-party activity– Implement a plug-in system

Page 18: Android Development...The 20,000-Foot View

   

Services and Multitasking

● The Download Scenario– User requests download of large file

● Should not need to keep activity going to accomplish this!

– Use a service and a background thread– Service either updates activity or displays

notification, then shuts down, when done

Page 19: Android Development...The 20,000-Foot View

   

Services and Multitasking

● The Music Player Scenario– User presses “play”

● Should not need to keep player activity running!

– Use a service, get control when song ends to change to next song in playlist

– Stop the service only when user presses “stop”● Use notification for ease of returning to player, plus

to let OS know what is going on

Page 20: Android Development...The 20,000-Foot View

   

Services and Multitasking

● The Email Client Scenario– Want to check for new messages every so often– Use AlarmManager to arrange for scheduled task

● Either only while phone is awake, or even if phone is asleep

– Use background thread, download mail headers– Update activity or show notification– Service shuts down to await next alarm

Page 21: Android Development...The 20,000-Foot View

   

App Widgets and Home Screens

● App Widget = You, on the Home Screen– Display key info at a glance– Light interactivity (launch an activity)– Update on demand or periodically– User control over roster, position

Page 22: Android Development...The 20,000-Foot View

   

App Widgets and Home Screens

● Replacement Home Screen– You advertise that you implement one– User gets choice when presses HOME

● Or sets a default

– You supply whatever experience you want!

Page 23: Android Development...The 20,000-Foot View

   

Tools

● Eclipse...– Android Developer Tools plugin– GUI preview mode– MOTODEV Studio for Android

● Adds many more tools to standard Eclipse/ADT

Page 24: Android Development...The 20,000-Foot View

   

Tools

● ...Or Not– IntelliJ IDEA– NetBeans– No particular IDE– No platform limitations

Page 25: Android Development...The 20,000-Foot View

   

Production

● APK File– Android “executable”– Digitally signed (self-signed certificate)– Freely distributable

● Not limited to Android Market or any other single venue

Page 26: Android Development...The 20,000-Foot View

   

Production

● Android Market– $25 setup fee– Upload and go

● Available on many devices within minutes of release

● Other Markets Available– Motorola SHOP4APPS– Verizon V-CAST

Page 27: Android Development...The 20,000-Foot View

   

What If I Hate Java?

● Web Technologies– HTML5– PhoneGap / Rhodes / Titanium Mobile– Adobe AIR

● Other Compiled JVM Languages (Scala)● Scripting Languages (JRuby)

Page 28: Android Development...The 20,000-Foot View

   

“Fragmentation”

● False Fragmentation = Choices– Consumer choices (screen size)– Manufacturer choices (hardware capabilities)– Carrier choices (device mix)– Developer choices

● Recognize that others' choices matter● Choose not to be chosen

Page 29: Android Development...The 20,000-Foot View

   

“Fragmentation”

● True Fragmentation– Device manufacturers who break the SDK– Carriers who limit the devices– Developers who go beyond the SDK boundaries– Garden-variety bugs

Page 30: Android Development...The 20,000-Foot View

   

Android's Future

● OS Releases– Gingerbread– Honeycomb– …– Expect 2-3 releases/year

● Good backwards compatibility

Page 31: Android Development...The 20,000-Foot View

   

Android's Future

● Google TV– Powered by Android– Android Market and SDK/add-on in early 2011

● Hardware Innovation and Experimentation– Desk phones for the enterprise– SonyEricsson LiveView– ???

Page 32: Android Development...The 20,000-Foot View

   

Where Do We Go From Here?

● General Android Information– PlanetAndroid.com– Twitter: #androiddev– Social networks (Facebook, LinkedIn, etc.)

Page 33: Android Development...The 20,000-Foot View

   

Where Do We Go From Here?

● Public Developer Support Resources– StackOverflow (#android)– Google Groups

● android-developers● android-discuss

– IRC– Other community support boards

Page 34: Android Development...The 20,000-Foot View

   

Where Do We Go From Here?

● Rich Web Experience 2010– Today

● Developing Android Apps Using Web Technologies● The Future of Mobile: Learn to Build W3C Widgets

and Device APIs with PhoneGap● Choices in Mobile Application Development

Page 35: Android Development...The 20,000-Foot View

   

Where Do We Go From Here?

● Rich Web Experience 2010– Friday

● Ted Neward's all-day Android-a-palooza (a.k.a., workshop)

● Easy Mobile Development Workshop: Mobile GUI Frameworks

● Easy Mobile Development Workshop: Appcelerator Titanium

Page 36: Android Development...The 20,000-Foot View

   

Q & A