Preface xxi About the Authors xxv
Chapter 1: Overview of Android 1
The Evolution of Android 1
The Dichotomy of Android 2
Devices Running Android 2
Hardware Differences on Android Devices 6
Features of Android 10
Android Development 11
Software Development Kit (SDK) 12
Google Play 16
Managing Reviews and Updates 19
Alternatives to Google Play 20
Chapter 2: Application Basics: Activities and Intents 21
Android Application Overview 21
Activity Lifecycle 31
Multiple Activities 36
Chapter 3: Threads, Services, Receivers, and Alerts 51
Threads 51
Messages between Threads: Handlers 58
Alerts 63
Services 69
Broadcast Receivers 82
App Widgets 85
Chapter 4: Advanced Threading Techniques 89
Loaders 89
AsyncTasks 91
Android Inter-Process Communication 94
Chapter 5: User Interface Layout 109
Resource Directories and General Attributes 109
Views and ViewGroups 112
Text Manipulation 124
Other Widgets: From Buttons to Seek Bars 130
Chapter 6: User Interface Events 145
Event Handlers and Event Listeners 145
Advanced User Interface Libraries 168
Chapter 7: Advanced User Interface Techniques 177
Android Custom View 177
Android Animation 183
Accessibility 189
Fragments 191
Chapter 8: Multimedia Techniques 199
Images 199
Audio 206
Video 217
Chapter 9: Hardware Interface 221
Camera 221
Other Sensors 227
Telephony 231
Bluetooth 236
Near Field Communication (NFC) 243
Universal Serial Bus (USB) 248
Chapter 10: Networking 251
Reacting to the Network State 251
Using SMS 255
Using Web Content 263
Social Networking 275
Chapter 11: Data Storage Methods 287
Shared Preferences 287
SQLite Database 297
Content Provider 306
File Saving and Loading 312
Chapter 12: Location-Based Services 315
Location Basics 315
Using Google Maps 325
Using the Little Fluffy Location Library 337
Chapter 13: In-App Billing 343
Google Play In-App Billing 343
Chapter 14: Push Messages 349
Google Cloud Messaging Setup 3 49
Sending and Receiving Push Messages 351
Receiving Messages 353
Sending Messages 356
Chapter 15: Android Native Development 361
Android Native Components 361
Chapter 16: Debugging 371
Android Test Projects 371
Eclipse Built-In Debug Tools 377
Android SDK Debug Tools 380
Android System Debug Tools 390
Appendix A: Using the OpenIntents Sensor Simulator 395
Setting Up the Sensor Simulator 395
Adding the Sensor Simulator to an Application 398
Appendix B: Using the Compatibility Pack 401
Android Support Packages 401
Adding the Support Library to a Project 408
Appendix C: Using a Continuous Integration System 409
Appendix D: Android OS Releases 411
Cupcake: Android OS 1.5, API Level 3, Released April 30, 2009 411
Donut: Android OS 1.6, API Level 4, Released September 15, 2009 411
Eclair: Android OS 2.0, API Level 5, Released October 26, 2009 412
Froyo: Android OS 2.2, API Level 8, Released May 20, 2010 412
Gingerbread: Android OS 2.3, API Level 9, Released December 6, 2010 412
Honeycomb: Android OS 3.0, API Level 11, Released February 22, 2011 413
Ice Cream Sandwich: Android OS 4.0, API Level 14,Released October 19, 2011 413
Jelly Bean: Android OS 4.1, API Level 16, Released July 9, 2012 414
Index 417