Skip to main content

Professional AndroidTM Application Development

Professional AndroidTM Application Development

Reto Meier

ISBN: 978-0-470-34471-2

Nov 2008

432 pages

Select type: Paperback

Product not available for purchase


A hands-on guide to building mobile applications, Professional Android Application Development features concise and compelling examples that show you how to quickly construct real-world mobile applications for Android phones. Fully up-to-date for version 1.0 of the Android software development kit, it covers all the essential features, and explores the advanced capabilities of Android (including GPS, accelerometers, and background Services) to help you construct increasingly complex, useful, and innovative mobile applications for Android phones.

What this book includes

  • An introduction to mobile development, Android, and how to get started.
  • An in-depth look at Android applications and their life cycle, the application manifest, Intents, and using external resources.
  • Details for creating complex and compelling user interfaces by using, extending, and creating your own layouts and Views and using Menus.
  • A detailed look at data storage, retrieval, and sharing using preferences, files, databases, and Content Providers.
  • Instructions for making the most of mobile portability by creating rich map-based applications as well as using location-based services and the geocoder.
  • A look at the power of background Services, using threads, and a detailed look at Notifications.
  • Coverage of Android's communication abilities including SMS, the telephony APIs, network management, and a guide to using Internet resources
  • Details for using Android hardware, including media recording and playback, using the camera, accelerometers, and compass sensors.
  • Advanced development topics including security, IPC, advanced 2D / 3D graphics techniques, and user–hardware interaction.

Who this book is for
This book is for anyone interested in creating applications for the Android mobile phone platform. It includes information that will be valuable whether you're an experienced mobile developer or making your first foray, via Android, into writing mobile applications. It will give the grounding and knowledge you need to write applications using the current SDK, along with the flexibility to quickly adapt to future enhancements.


Chapter 1: Hello, Android.

A Little Background.

What It Isn’t.

An Open Platform for Mobile Development.

Native Android Applications.

Android SDK Features.

Introducing the Open Handset Alliance.

What Does Android Run On?

Why Develop for Android?

Introducing the Development Framework.

What Comes in the Box.


Chapter 2: Getting Started.

Developing for Android.

Developing for Mobile Devices.

To-Do List Example.

Android Development Tools.


Chapter 3: Creating Applications and Activities.

What Makes an Android Application?

Introducing the Application Manifest.

Using the Manifest Editor.

The Android Application Life Cycle.

Understanding Application Priority and Process States.

Externalizing Resources.

A Closer Look at Android Activities.


Chapter 4: Creating User Interfaces.

Fundamental Android UI Design.

Introducing Views.

Introducing Layouts.

Creating New Views.

Creating and Using Menus.


Chapter 5: Intents, Broadcast R eceivers, Adapters, and the Internet.

Introducing Intents.

Introducing Adapters.

Using Internet Resources.

Introducing Dialogs.

Creating an Earthquake Viewer.


Chapter 6: Data Storage, Retrieval, and Sharing.

Android Techniques for Saving Data.

Saving Simple Application Data.

Saving and Loading Files.

Databases in Android.

Introducing Content Providers.


Chapter 7: Maps, Geocoding,: and Location-Based Services.

Using Location-Based Services.

Setting up the Emulator with Test Providers.

Selecting a Location Provider.

Finding Your Location.

Using Proximity Alerts.

Using the Geocoder.

Creating Map-Based Activities.

Mapping Earthquakes Example.


Chapter 8: Working in the Background.

Introducing Services.

Using Background Worker Threads.

Let’s Make a Toast.

Introducing Notifications.

Using Alarms.

Using Alarms to Update Earthquakes.


Chapter 9: Peer-to-Peer Communication.

Introducing Android Instant Messaging.

Introducing SMS.


Chapter 10: Accessing Android Hardware.

Using the Media APIs.

Using the Camera.

Introducing the Sensor Manager.

Using the Accelerometer and Compass.

Android Telephony.

Using Bluetooth.

Managing Network and Wi-Fi Connections.

Controlling Device Vibration.


Chapter 11: Advanced Android Development.

Paranoid Android.

Using AIDL to Support IPC for Services.

Using Internet Services.

Building Rich User Interfaces.



Additional Download Code
ChapterPageDetailsDatePrint Run
40Error in Code
There is a line of code missing for Steps 6-8. The highlighted line should be inserted as follows in each step:

public void onCreate(Bundle icicle) {

// Inflate your View

65Error in Code
In the first snippet, the final (shaded) line should read:


96Error in Code
In the last shaded section, the second line should read:


And the following line should be moved from its current location to become the first line in the highlighted section:

Resources r = this.getResources();

155Typo in Code
In final code sample:


Should be:


203Error in Code
if( dbCount > 0 ) {

Should be:

if( dbCount == 0) {