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

Post on 14-May-2015

1399 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

Transcript

   

Rich Web Experience 2010

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?!?

   

Welcome to Android!

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

   

Welcome to Android

● Development Models– Standard Applications

● Java● Web technologies

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

   

Basket of Components

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

   

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)

   

Basket of Components

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

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

   

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)

   

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

   

Java and Dalvik

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

   

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

   

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)

   

Resources

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

   

Resources

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

   

Intents and Integration

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

   

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

   

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

   

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

   

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

   

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

   

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

   

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!

   

Tools

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

● Adds many more tools to standard Eclipse/ADT

   

Tools

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

   

Production

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

● Not limited to Android Market or any other single venue

   

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

   

What If I Hate Java?

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

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

   

“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

   

“Fragmentation”

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

   

Android's Future

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

● Good backwards compatibility

   

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– ???

   

Where Do We Go From Here?

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

   

Where Do We Go From Here?

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

● android-developers● android-discuss

– IRC– Other community support boards

   

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

   

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

   

Q & A

top related