2. Welcome to Android!
● High Momentum
– Today: smartphones
– Tomorrow: tablets and televisions
– Later: cars? toasters? cars that make toast?!?
3. Welcome to Android!
● Opportunities
– Retail Distribution (Android Market, etc.)
– OEM Distribution
– Internal Distribution (enterprise, etc.)
– Social Distribution
4. Welcome to Android
● Development Models
– Standard Applications
● Java
● Web technologies
– Games
● 2D (Canvas)
● 3D (OpenGL)
5. Basket of Components
● Activity
– Primary unit of user interface
– Think: screen, page, window
– “User transaction”
– Design model: lots of cheap activities
6. 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)
7. Basket of Components
● Broadcast Receiver
– System events (battery low)
– Application messages
● Content Provider
– Integration point (expose database)
– Abstraction layer (expose Web service)
8. 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)
9. 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
10. Java and Dalvik
● What You Write
– Java
– XML
– C/C++ (optional)
11. 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
12. 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)
14. Resources
● Resource Sets
– Language
– Screen density
– Screen size
– Dozens of other criteria
15. Intents and Integration
● Intents as Message Bus
– Start an activity
– Start a service
– Send a broadcast
16. 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
17. 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
18. 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
19. 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
20. 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
21. 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
22. 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!
23. Tools
● Eclipse...
– Android Developer Tools plugin
– GUI preview mode
– MOTODEV Studio for Android
● Adds many more tools to standard Eclipse/ADT
24. Tools
● ...Or Not
– IntelliJ IDEA
– NetBeans
– No particular IDE
– No platform limitations
25. Production
● APK File
– Android “executable”
– Digitally signed (self-signed certificate)
– Freely distributable
● Not limited to Android Market or any other single
venue
26. 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
27. What If I Hate Java?
● Web Technologies
– HTML5
– PhoneGap / Rhodes / Titanium Mobile
– Adobe AIR
● Other Compiled JVM Languages (Scala)
● Scripting Languages (JRuby)
28. “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
29. “Fragmentation”
● True Fragmentation
– Device manufacturers who break the SDK
– Carriers who limit the devices
– Developers who go beyond the SDK boundaries
– Garden-variety bugs
30. Android's Future
● OS Releases
– Gingerbread
– Honeycomb
– …
– Expect 2-3 releases/year
● Good backwards compatibility
31. 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
– ???
32. Where Do We Go From Here?
● General Android Information
– PlanetAndroid.com
– Twitter: #androiddev
– Social networks (Facebook, LinkedIn, etc.)
33. Where Do We Go From Here?
● Public Developer Support Resources
– StackOverflow (#android)
– Google Groups
● android-developers
● android-discuss
– IRC
– Other community support boards
34. 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
35. 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