Errata for The Busy Coder's Guide to Android Development

A quick reminder: if you see problems in the book that are not listed here, report them via the Book Bug Bounty program!

Version 3.1 (digital) - June 2010

  1. The Table of Contents entry for "...And Checking It Twice" links to the wrong page.
  2. Pages 9-10 suggest that the android create project command will create a tests/ directory, when it does not.
  3. The last line of code on page 23 has --package com.commonsware.android.now where it should have --package com.commonsware.android.skeleton
  4. The last sentence of the first paragraph of page 32 is missing the last four words, "later in this chapter".
  5. The first paragraph of page 92 has android:verticalSpacing="35" where it should have android:verticalSpacing="35px".
  6. The list of callbacks on page 95 missed afterTextChanged().
  7. Page 276 refers to a Files/Static sample application as if that had been covered before, but that sample does not appear until page 321.
  8. Page 314 has the parameters to query() slightly out of order in the bulleted list. The "having" clause should appear before the "order by" clause in the last two parameters.
  9. Page 504 has a link to the Android Open Source Project, but after that site was reorganized, the link no longer works. Here is the proper link.

Version 3.0 (digital) - February 2010

  1. Page 23 has com.commonsware.android.Now where it should have com.commonsware.android.now (lowercase n).
  2. Page 25 has android.Activity where it should have android.app.Activity.
  3. Page 60 implies that we do our if() test on the supplied RadioGroup. In the code, though, we switch on the supplied radio button ID.
  4. Page 125 has a code sample that shows calling getLayoutInflater() on a Context. That is incorrect. For an inner class of Activity, just call getLayoutInflater() directly, to reach the Activity's own implementation.
  5. Page 211 says that we sleep for a quarter-second to simulate real work, but the code snippet above shows the delay is 200 milliseconds.
  6. The chapter on Notifications fails to mention that you need Notification.FLAG_SHOW_LIGHTS in your flags in order to use the LEDs.
  7. The code snippet on Page 310 is missing the second parameter in the call to rawQuery(), which should be null.
  8. Page 362 has "An optional feature your content provider to its clients", which should be "An optional feature your content provider may offer to its clients".

Version 2.9 (digital) - January 2010

  1. Pages 41 and 66 have "definining" where they should have "defining".
  2. Page 67 has "Next, we define the label, which is fairly basic, except for its own 15-pixel padding (android:padding = "15px")." — the attribute should be android:paddingTop.
  3. Page 142 has "straight-foward" where it should have "straight-forward".
  4. Pages 224 and 263 reference activityCreator, which has been replaced with android create project.
  5. Page 293 has an incorrect screenshot, showing "Simple Preferences" for a heading when it should be "Other Preferences".
  6. Page 302 has "CosntantsBrowser" where it should have "ConstantsBrowser".
  7. Page 374 has "explictly" where it should have "explicitly".
  8. Page 380 has "handes" where it should have "handles".
  9. Page 395 has "Critieria" where it should have "Criteria".
  10. Pages 469 and 472 have "idiosyncracies" where they should have "idiosyncrasies".
  11. Page 473 has "stylii" where it should have "styli".
  12. Page 473 has "ANRDROID_ID" where it should have "ANDROID_ID".

Version 2.8 (digital) - November 2009

  1. Page 14 has "These are called br9adcast receivers", which should be "These are called broadcast receivers". The author is sufficiently mortified.
  2. Page 15 shows the use of a minSdkVersion attribute in a code sample, but it leaves off the android: namespace prefix.
  3. Page 20 has "There should be a new values", which should be "There should be a new value".
  4. Pages 109-111 demonstrate a technique for using new editions of getTag() and setTag() to get some of the value of a holder/wrapper class without needing a custom class. It has been pointed out that this technique, while works, may suffer from performance issues on larger lists.
  5. Page 136 has "Note that the TabWidget and FrameLayout are immediate children of the TabHost", which is no longer true as of this version of the book.
  6. Page 210 claims that onPostExecute() takes a varargs parameter, when it does not &mdash it only takes a single value of the third generic data type.
  7. Page 224 has "add an receiver" where it should have "add a receiver".
  8. Page 267 has "such a widget's padding" where it should have "such as a widget's padding".
  9. Page 326 has "Beyond that, though, there the Android Scripting Environment (ASE)", which should be "Beyond that, though, there is the Android Scripting Environment (ASE)".
  10. Page 356 has "An optional feature your content provider to its clients", which should be "An optional feature your content provider may offer to its clients".
  11. Page 359 has "or a once at install time", which should be "or all at once at install time".
  12. Page 374 has "To start a service, on approach is", which should be "To start a service, one approach is".
  13. Page 374 has "if its your own service", which should be "if it's your own service".
  14. Page 381 has "where you supply an PendingIntent", which should be "where you supply a PendingIntent".
  15. Page 390 has "You will also a permission in your application", which should be "You will also need a permission in your application".
  16. Page 402 has "remember to multiple the", which should be "remember to multiply the".
  17. Page 402 has "offers toggleSatellite(), which, as the names suggest, toggle", which should be "offers toggleSatellite(), which, as the name suggests, toggles".
  18. Page 415 has "navigate to spot", which should be "navigate to the spot".
  19. Page 448 has "to see what your application looks on different devices", which should be "to see what your application looks like on different devices".
  20. The code sample spanning pages 457-8 is a duplicate of a previous code sample. This one should have android:textSize="5mm"
  21. Page 467 has "Ther are few", that should be "There are few".
  22. Page 469 indicates that the ARCHOS 5 Android tablet lacks GPS — this is incorrect. It does, however, lack Google Maps as of the time of this writing.

Version 2.1 (digital) - July 2009

  1. Page 16 twice erroneously refers to android:versionCode as android:versionNumber
  2. Page 24 has "the directory where you wan the skeleton", where it should have, "the directory where you want the skeleton"
  3. Page 24 also has the wrong package name for the android create project example. The package should be com.commonsware.android.skeleton.
  4. Page 26 references android.Activity where it should have android.app.Activity.
  5. Page 27 references using tools/emulator to launch the emulator, which is still true, but you need to provide an -avd switch to name the AVD you wish to use. For more on AVDs, see the Getting Going chapter, earlier in the book.
  6. The first bullet on page 66 has android:layout_toRight where it should have android:layout_toRightOf
  7. Page 79, towards the top, has "...widgets, in turn, will be shown the list or spinner...", which should be "...widgets, in turn, will be shown in the list or spinner..." (emphasis added).
  8. Page 124 indicates that newView() should call bindView(). Actually, CursorAdapter and subclasses do that for you, so newViw() should just return the empty row — bindView() will then be called automatically.
  9. Page 130 includes the phrase "All you need to do it put them", where it should be "All you need to do is put them"
  10. Page 211 says that the doInBackground() sleeps for "a quarter-second", when it actually sleeps for 200ms.
  11. Page 212 claims that onPostExecute() takes a varargs parameter, when it does not &mdash it only takes a single value of the third generic data type.
  12. Page 230 has RESULT_CANCELLED where it should have RESULT_CANCELED.
  13. Page 252 has R.layout.another_field in a code sample, where it should be R.id.another_field
  14. The example at the bottom of Page 252, and the example at the top of Page 257, both have a redundant xmlns:android declaration.
  15. Page 271, in the third paragraph, has "and how to use it in other environment than Android", which should be "and how to use it in an environment other than Android"
  16. Page 294, in the third paragraph, refers to a "representation of the request body", where it should have "representation of the response body"
  17. The first sentence of page 312 should be "This chapter covers the first scenario; the second is covered in The Busy Coder's Guide to Advanced Android Development"
  18. Page 346, in the first paragraph, refers to getContentProvider(), which should be getContentResolver().
  19. Page 360 has the phrase "means that observer that initiated", which should be "means that the observer that initiated"
  20. Page 406 refers to a screenshot that is not in this edition of the book.
  21. Page 410 has the old paths for the debug keystore locations in Windows. Please refer to the Maps API documentation for the correct locations.

Version 2.0 (print) - January 2009

If you are trying to use this book with the Android 1.5 SDK, please be advised that this book was written many months before that SDK's release, and so the technology has shifted. You may wish to trade in your print book for a Warescription, so you can get updates that more closely track Android itself.

  1. Page 245 has the phrase "in that the break down the SQL statements", which should be "in that they break down the SQL statements"
  2. Page 336 has the phrase "means that observer that initiated", which should be "means that the observer that initiated"

Version 2.0 (digital) - January 2009

  1. Page 113, near the bottom, says "we need to add a checkbox", where it should say, "we need to add a RatingBar"
  2. Page 194 has "amd" in the first full paragraph instead of "and".
  3. The prose around the sample on Page 242 refers to one statement to create the table and a second statement to create an index. The code sample only shows one statement, because the source of the statement (Provider.java in ContentProvider/Constants) does not create an index.
  4. On page 243, in the third paragraph, "in that the break down" should be "in that they break down".
  5. Page 245, just before the example snippet, compares this snippet to the previous snippet (on page 244) — the two snippets are actually unrelated.
  6. Page 274, and perhaps other places, refer to BroadcastReceiver as being an interface. In reality, it is an abstract class.
  7. On page 334, the text shown in bold is missing: "An optional feature your content provider might offer to its clients is notify-on-change support. This means that your content provider will let clients know if the data for a given content Uri changes."
  8. Page 368 cites a number of permissions needed for developing location-aware applications, but most of those permissions are obsolete. The two main permissions you may need are ACCESS_FINE_LOCATION (for GPS) or ACCESS_COARSE_LOCATION.
  9. Page 372 cited "previous" source code — in reality, it is referring to the Weather and WeatherPlus sample applications.
  10. Links throughout the book to the Building 'Droids column on AndroidGuys.com have the incorrect URL.

Version 1.9 - Early December 2008

  1. On page 140, the book indicates that onCreateOptionsMenu() is called each time a menu is displayed. This is incorrect — it is only called once. However, onPrepareOptionsMenu() is called just before displaying the menu each time it is requested by the user.
  2. On page 142, the book indicates that you can only get the ContextMenuInfo menuInfo in onCreateContextMenu(). In reality, you can also get this by calling getMenuInfo() on the MenuItem passed into onContextItemSelected().
  3. Page 180 refers to runOnUIThread(), which should be runOnUiThread().
  4. The example array resource on page 231 is very wrong.
  5. On page 285, the third full paragraph ("The intent filter also...") should be deleted.
  6. Page 312 refers to android.provider.CONTENT_URI, which should be android.provider.Contacts.CONTENT_URI.

Plus many others too numerous to mention — just download Version 2.0.2!

Version 1.4 - Early November 2008

  1. On page 96, the book refers to contentView where it should refer to convertView.
  2. On page 121, the book refers to a "later chapter" about threads but fails to provide a hyperlink.
  3. On page 135, the book's source code has the flip interval set at 2 seconds (2000 milliseconds), but the prose later incorrectly says the flip interval is 1.5 seconds.
  4. On page 137, please ignore the backslash that accidentally was added at the end of the page.
  5. On page 146, the prose refers to four menu choices, when (in this version of the sample) there are actually seven.
  6. On page 150, the sentence "For example, from the Inflation sample project, here is menu called sample.xml:" is missing the word "a" between "is" and "menu".
  7. Page 238 is missing two words — the phrase "one in and one in for use in landscape mode" should be "one in portrait mode and one in for use in landscape mode".
  8. Page 259 shows a sample path to a SQLite database on the phone, but includes the .db extension. This extension is not added by default when creating a database in Android, so it is more likely that your database will not have any extension.
  9. The last paragraph on page 302 is missing the word "than" at the end of the phrase "but by means other".
  10. Page 338 refers to Parcelable with a "(see below)" note, but there is no additional material on that interface.

Version 1.3 - Late September 2008

  1. Page 25's second paragraph should read: "With that in mind, it's time to break out the XML and learn how to lay out Android activity views that way."
  2. Page 41 is missing a verb — the end of the last sentence of the first paragraph of "The Activity" should read "which is where your first activity will go."
  3. Page 60 has three bullets, the second and third of which are repeated. The third should actually be android:layout_witdh="fill_parent".
  4. Page 76 indicates that the Spinner choices can be selected via clicking on the left and right D-pad buttons. This is no longer the case — the only way to choose an item from the spinner is to activate it (e.g., click the center D-pad button) and choose an option from the dialog.
  5. Pages 80-81 show horizontalSpacing and columnWidth values as pure numbers, when they should be dimensions (e.g., 100px).
  6. On pages 93, 128, and 397, ViewInflate should be changed to LayoutInflater.
  7. On Page 107, the screenshot is incorrect, probably taken from the subsequent example. The screenshot should show the three-starred item with an all-caps label.
  8. The third line of Page 122 shows a 0 that is not in monospace font, and so may appear to look like an O.
  9. Pages 174 and 396 refer to an obsolete UIThreadUtilities class.
  10. On page 213, the sample code for the ReadWriteFileDemo is cut off. If you wish to see the full listing, the easiest solution is to download the source code.
  11. On page 229, where it says Resources.getColor(R.dimen.forest_green), it should really say Resources.getColor(R.color.forest_green).
  12. On pages 275, 281, and 402, startSubActivity() should be changed to startActivityForResult().
  13. On pages 275, 318, and 398, broadcastIntent() should be changed to sendBroadcast().
  14. Page 287 uses ALTERNATE_CATEGORY and ALTERNATIVE_CATEGORY instead of CATEGORY_ALTERNATIVE, while page 288 uses DEFAULT_CATEGORY instead of CATEGORY_DEFAULT./li>
  15. The Pick sample application (in the Introspection chapter) indicates that it needs special permissions to be able to pick contacts &mdash this is not the case with Android 1.0r1.

Version 1.2 - September 2008

See problem #3 from Version 1.0. Also:

  1. On page 7, where it says there are "five key items", it should be "seven key items"
  2. In the chapter on Maps, in the "Drawing the ItemizedOverlay" section, the "fourth bullet" should actually be the "last bullet"
  3. On page 12, the second paragraph refers to com.commonsware.android where it should refer to com.commonsware.android.search to line up with the example shown at the top of the page
  4. On page 42, the first bullet refers to R.id.rb1 — this is not referencing the example shown below it, but rather just an arbitrary possible radio button ID
  5. On page 60, the second paragraph refers to 16 in two places where it should be 15.
  6. On page 223, the bulleted list of parameters to query() is missing the HAVING parameter.
  7. On page 225, count() should be getCount(), first() should be moveToFirst(), next() should be moveToNext(). Also, the code example is missing result.moveToFirst(); between the query and the while loop to get the Cursor properly positioned, and it to has an erroneous next() that should be moveToNext().

Version 1.1 - August 2008

See problems #1-3 below

Version 1.0 - July 2008

  1. On page 26-27, the "And We Attach These To Java...How?" section references a fictitious snicklefritz.xml — this name has no relevance to any example in this chapter. It's just a name.
  2. On page 106, the text refers to the example setting the background color of the list to the selected hue. The example was rewritten to change divider thickness instead of background color, but we forgot to change the one mention of the background color.
  3. In various places in the book, the EditText class is incorrectly referred to as EditView.

Version 0.9 - June 2008

The Kindle, and to a lesser extent the PDF, have some problems with formatting of source code in the examples. If you cannot read the source code in the ebook, download the source separately. This is also useful if you would like to compile and run any of the samples.