Print this page Share

Professional Android 2 Application Development

ISBN: 978-0-470-56552-0
576 pages
March 2010
Professional Android 2 Application Development (0470565527) cover image
Update to the bestseller now features the latest release of the Android platform

Android is a powerful, flexible, open source platform for mobile devices and its popularity is growing at an unprecedented pace. This update to the bestselling first edition dives in to cover the exciting new features of the latest release of the Android mobile platform.

Providing in-depth coverage of how to build mobile applications using the next major release of the Android SDK, this invaluable resource takes a hands-on approach to discussing Android with a series of projects, each of which introduces a new feature and highlights techniques and best practices to get the most out of Android.

  • The Android SDK is a powerful, flexible, open source platform for mobile devices
  • Shares helpful techniques and best practices to maximize the capabilities of Android
  • Explains the possibilities of Android through the use of a series of detailed projects
  • Demonstrates how to create real-world mobile applications for Android phones
  • Includes coverage of the latest version of Android

Providing concise and compelling examples, Professional Android Application Development is an updated guide aimed at helping you create mobile applications for mobile devices running the latest version of Android.

See More

CHAPTER 1 Hello, Android.

CHAPTER 2 Getting Started.

CHAPTER 3 Creating Applications and Activities.

CHAPTER 4 Creating User Interfaces.

CHAPTER 5 Intents, Broadcast Receivers, Adapters, and the Internet.

CHAPTER 6 Files, Saving State, and Preferences.

CHAPTER 7 Databases and Content Providers.

CHAPTER 8 Maps, Geocoding, and Location-Based Services.

CHAPTER 9 Working in the Background.

CHAPTER 10 Invading the Phone-Top.

CHAPTER 11 Audio, Video, and Using the Camera.

CHAPTER 12 Telephony and SMS.

CHAPTER 13 Bluetooth, Networks, andWi-Fi.

CHAPTER 14 Sensors.

CHAPTER 15 Advanced Android Development.


See More
Reto Meier is a software developer who has been involved in Android since the initial release in 2007. He is an Android Developer Advocate at Google.
See More
Download TitleSizeDownload
Code Download :: Code Listings 47.13 KB Click to Download
Code Download :: Example Projects 738.86 KB Click to Download
See More

Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
26 Error in Text
On page 26, in the tip box at line 4:

The text refers to the "Manage..." button, but the name of the button is actually "Manager..."
53 Error in Text
On top of page, first paragraph:
80 Error in Text
In Figure 3.7 the state block "onSaveInstanceState" and "onRestoreInstanceState" should be swapped.
108 Error in Code
Section 5: in the code listing for the initCompassView method, the variable 'r' is referenced before it is declared, in the line 'circlePaint.setColor(r.getColor(R.color.background_color));'.

should read:
Resources r = this.getResources(); 

circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG); 

northString = r.getString(R.String.cardinal_north);
111-117 Error in Text
Ch.4, Drawable resources:
The paragraph shows various "snippets" of code/xml (the listings), but forgets to mention how to actually "use" a drawable resource, e.g. referring to it in some xml layout or in some activity code.
127 Error in Text
Ch.10, 'Dynamically Updating Menu Items', 2nd paragraph, 1st sentence:

in sentence:
'[...] you can either find a reference to them in the onCreateOptionsMenu [...]'
'find' should be substituted in favor of 'store' or something similar.
129-130 Error in Code
Ch.4, Listing 4-29:

All 3 occurences of 'menu.FIRST' should be 'Menu.FIRST', so not to issue compiler warnings as FIRST is static.

The code invokes 'setIcon' method on a menu item from a context menu. But as said in following explanation, icons on those items are not displayed, while icons are displayed for context menu header. Should invoke 'setHeaderIcon' on context menu.
131 Error in Text
Ch-4, last sentence before listing 4-31:

typo: 'MenuInflator' --> 'MenuInflater'
4 133 Error in Text
step. 6:Although the text says "For the code in Step 5 to work you need to increase the scope of the todoListItems and ListView control beyond the onCreate method", only ListView scope needs to increase. In step 5 todoListItems is not used at all.
5 141 Error in Text
Listing 5-5:

catpion should read ?Returning results from an Activity?.
146 Error in Text
In Listing 5-7, line 5:


Should be


7 232 Error in Code
The text to initialize DATABASE_CREATE constant in earthquakeDatabaseHelper class has an aditional parenthesis, which provokes an SQLLiteException syntax error:

Should read:
8 276 Error in Code
Listing 8-12:
case 1

should be:
case 0
8 281 Error in Code
Step 5.1:

"ContentResolver resolver" is not needed in this piece of code. Should be (all on one line):

public EarthquakeOverlay(Cursor cursor) {
8 283 Error in Code
Step 6:
String earthquakeURI = ...

Should be

Uri earthquakeURI = EarthquakeProvider.CONTENT_URI; 
9 290 Error in Note
Replace both instances of MY_ACTION in the note to ORDER_PIZZA
9 294 Error in Code
Step 5:

Preferences.USER_PREFERENCE was not defined in pre-existing code
9 296 Error in Code
Step 7.1:


Should be:
9 297 Error in Code
Step 7.3:

should not be bold

AND insert the following additional line immediately before the above mentioned line. The inserted line should be bold:
13 450 Error in Code
listing 13-13:
should be: }},
450 Error in Code
Ch.13 p.450 listing 13-14:
int networkType = networkInfo.getType();

should be:
int networkType = activeNetwork.getType();

Replace "networkInfo" with "activeNetwork"
13 451 Error in Code
'Finding and Configuring Network Preferences and Controlling Hardware Radios':

Prefix the sentence that starts, "You can find the current..." with "In some versions of Android, "
See More

Related Titles

Back to Top