Chapter 1. Introducing Android
Figure 1.2. Android’s built-in browser technology is based on WebKit’s browser engine.
Figure 1.3. The Android stack offers an impressive array of technologies and capabilities.
Figure 1.7. This Android application demonstrates a simple Activity and Intent.
Chapter 2. Android’s development environment
Figure 2.2. The Package Explorer allows you to browse the elements of your Android projects.
Figure 2.3. The Problems view shows any errors in your source code.
Figure 2.5. DDMS perspective with an application running in the Android emulator
Figure 2.7. Sending a test SMS to the Android emulator
Figure 2.8. The adb tool provides interaction at runtime with the Android emulator.
Figure 2.9. Using the shell command of the adb, you can browse Android’s filesystem.
Figure 2.13. The Android application file format is pzip compatible.
Figure 2.14. The installed Android packages listed in the AVD and SDK Manager
Figure 2.17. Creating a new launch configuration for testing your Android application
Figure 2.18. Create a new run configuration based on the Android template.
Figure 2.19. Setting up the Android emulator launch configuration
Figure 2.20. Selecting the AVD to host the application and specify launch parameters.
Figure 2.21. Adding the run configuration to the toolbar menu
Figure 2.22. Starting this chapter’s sample application, an Android tip calculator.
Figure 2.23. The Debug perspective permits you to step line-by-line through an Android application.
Chapter 3. User interfaces
Figure 3.6. Common ViewGroup classes with LayoutParams and properties provided
Chapter 4. Intents and Services
Figure 4.2. The portions of a URI that are used in Android, showing scheme, authority, and path
Figure 4.3. Example Intent and IntentFilter matching using a filter defined in XML
Figure 4.4. The WeatherReporter application, showing the weather forecast for the current location
Figure 4.5. Warning from a background application about severe weather
Chapter 5. Storing and retrieving data
Figure 5.1. The Android File Explorer view showing preferences file permissions
Figure 5.2. Two separate applications getting and setting SharedPreferences
Figure 5.4. The WeatherReporter Saved Locations screen, which pulls data from a SQLite database
Chapter 6. Networking and web services
Figure 6.1. The NetworkExplorer application you’ll build to cover networking topics
Figure 6.2. The output of the NetworkInfo toString method
Figure 6.3. The relationship between HttpClient, ResponseHandler, and Android Handler
Figure 6.4. The Delicious recent posts screen from the NetworkExplorer application
Chapter 7. Telephony
Figure 7.2. Displaying device and phone network meta-information obtained from TelephonyManager
Figure 7.3. An Android console session demonstrating the gsm command and available subcommands
Chapter 8. Notifications and alarms
Figure 8.1. A simple Toast, the SMSNotifyExample, shown running in the emulator
Figure 8.2. Example of a Toast message being generated from an SMS message
Figure 8.3. Using the Android DDMS to send an SMS message to the application
Figure 8.4. The expanded SMS inbox displaying the contentIntent and appIntent
Figure 8.5. Example of the SimpleAlarm application running in the emulator
Figure 8.6. After the Alarm runs, the application shows a simple Toast message.
Chapter 9. Graphics and animation
Figure 9.1. A simple red rectangle drawn using Android’s Graphics API
Figure 9.2. Various shapes drawn using XML
Figure 9.3. Making a ball bounce using an Android XML animation
Figure 9.4. A simple animation of a globe bouncing in front of the Android logo
Figure 9.5. How two triangles are drawn from an array of vertices
Figure 9.6. A simple rectangle drawn on our surface using OpenGL ES
Chapter 10. Multimedia
Figure 10.1. OpenCORE’s services and architecture
Figure 10.2. Simple media player example
Figure 10.3. Playing an MP4 video in the Android emulator
Figure 10.5. The Android emulator shows placeholder images for each photo taken.
Figure 10.6. An example of audio files being saved to the SD card image in the emulator
Figure 10.7. Photograph of VideoCam application running on an HTC Hero 2.
Chapter 11. Location, location, location
Figure 11.1. Screens from the Wind and Waves location-aware application
Figure 11.4. Using the DDMS tool with a GPX file to send mock location information
Figure 11.5. Using the DDMS tool with a KML file to send mock location information
Figure 11.7. The MapViewActivity from the Wind and Waves application using satellite mode
Chapter 12. Putting Android to work in a field service application
Figure 12.1. Data flows between the home office and a mobile worker
Figure 12.2. The field service application and dispatchers both leverage server-side transactions.
Figure 12.3. This figure depicts the basic flow of the field service application.
Figure 12.4. Resource files used in the sample application
Figure 12.5. The splash screen
Figure 12.6. The home screen. Less is more.
Figure 12.7. Settings screen in use
Figure 12.8. The ProgressDialog in use during RefreshJobs
Figure 12.9. ManageJobs Activity lists downloaded jobs.
Figure 12.10. An example of a job shown in the ShowJob Activity
Figure 12.11. Viewing a job address in the Maps application
Figure 12.12. Get Product Info takes the user to a web page specific to this job.
Figure 12.13. The CloseJob Activity capturing a signature and sending data to the server
Chapter 13. Building Android applications in C
Figure 13.1. Android runs atop a Linux kernel.
Figure 13.2. The build, copy, run cycle
Figure 13.3. Available libraries in /system/lib
Figure 13.4. Android libraries pulled to the development machine
Figure 13.5. Hello Android, static and dynamically linked
Figure 13.6. A better-behaving dynamic version of Hello Android
Figure 13.7. Interact with SQLite 3 from the command line in the adb shell.
Figure 13.8. The SQLite database on the development machine
Figure 13.9. DayTime Server running in the shell
Chapter 14. Bluetooth and sensors
Figure 14.1. Bluetooth settings screen
Figure 14.2. Options for a paired device
Figure 14.3. LEGO controller prompts for a PIN
Figure 14.4. Pairing with the LEGO robot
Figure 14.5. Simple LEGO NXT robot with motors connected to B and C ports
Figure 14.6. Waiting to connect to a robot
Figure 14.7. Connected to the robot with the motors stopped
Figure 14.8. Both motors are moving backward.
Figure 14.9. Spinning to the left
Figure 14.10. Disconnected state, waiting for a new connection
Chapter 15. Integration
Figure 15.1. Making entries in the native Contacts application
Figure 15.2. Fixed-length storage records
Figure 15.3. Open-ended storage records
Figure 15.4. Querying the contacts database
Figure 15.5. Combining raw contact data into unique contacts
Figure 15.6. Joining and separating contacts
Figure 15.7. Partially complete contact requested by application
Figure 15.8. Synchronizing data across multiple terminals
Figure 15.9. Retrying a synchronization operation after initial failure
Figure 15.10. Managing accounts
Figure 15.11. Managing multiple accounts
Figure 15.12. Login screen for LinkedIn account
Figure 15.13. A contact with standard and LinkedIn data
Figure 15.14. Choosing whether to display all LinkedIn contacts
Chapter 16. Android web development
Figure 16.2. The viewport tag modifies the appearance of the web page.
Figure 16.3. Scaled-up web page
Figure 16.5. The sample SQL application
Figure 16.6. Saving a new record
Figure 16.7. Listing the records from the table
Figure 16.8. Confirming deletion of records
Figure 16.9. Testing in the WebKit browser
Figure 16.10. index.html used in our sample application
Figure 16.11. index.html in our browser control
Figure 16.12. Entering a phone number in the web page
Figure 16.14. The Info button shows a Toast notification.
Figure 16.15. The toString method called from JavaScript
Figure 16.16. A crashed application thanks to the wait function
Figure 16.17. Setting up a search term
Chapter 17. AppWidgets
Figure 17.1. Power Control Widget on the home screen
Figure 17.2. Add to home screen
Figure 17.3. Choose a widget, any widget.
Figure 17.4. Tweeting about this chapter!
Figure 17.5. Four instances of the SiteMonitor AppWidget on the home screen
Figure 17.6. Site details, including hot-linked text
Figure 17.7. Easy dialing to an affected user
Figure 17.8. Monitor the good news also—revenue!
Figure 17.9. Architectural diagram of the SiteMonitor application
Chapter 18. Localization
Figure 18.1. English locales on Android emulator
Figure 18.2. On-device locale options
Figure 18.3. Date and time settings
Figure 18.6. Multiple strings.xml files
Figure 18.7. Localized screen referencing strings directly in layout
Figure 18.9. A job list in English
Figure 18.10. Job listings screen in en_US locale
Chapter 19. Android Native Development Kit
Figure 19.2. Application waiting to take photo
Figure 19.3. Take a photograph.
Figure 19.4. Captured image before image processing
Figure 19.5. Showing the edges of the car
Figure 19.6. A project in the Eclipse GUI
Figure 19.7. Building the JNI library
Figure 19.8. Project properties
Figure 19.9. External tool properties
Appendix A. Installing the Android SDK
Figure A.1. The java –version command displays the version of Java installed on your computer
Figure A.3. Eclipse defaults to the home screen. Go to the workbench.
Figure A.4. Android development takes place in the Java Perspective.
Figure A.5. Unzip the Android SDK archive to your hard drive.
Figure A.6. The packages available for download
Figure A.7. The currently installed packages
Figure A.8. Defining an Android virtual device, also known as an emulator
Figure A.9. The Eclipse environment supports an extensible plug-in architecture.
Figure A.10. Choose the new features option.
Figure A.11. Create a new update site to search for Android-related tools.
Figure A.12. You must select Android Tools for Eclipse to download and install.
Appendix B. Publishing applications
Figure B.2. Managing Android Market applications
Figure B.3. Managing the APK file and screenshots
Figure B.4. Textual descriptions of application along with publication options
Figure B.5. The newly published application becomes available on the device in mere moments.