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
- The Table of Contents entry for "...And Checking It Twice" links to the wrong page.
- Pages 9-10 suggest that the
android create projectcommand will create atests/directory, when it does not. - The last line of code on page 23 has
--package com.commonsware.android.nowwhere it should have--package com.commonsware.android.skeleton - The last sentence of the first paragraph of page 32 is missing the last four words, "later in this chapter".
- The first paragraph of page 92 has
android:verticalSpacing="35"where it should haveandroid:verticalSpacing="35px". - The list of callbacks on page 95 missed
afterTextChanged(). - Page 276 refers to a
Files/Staticsample application as if that had been covered before, but that sample does not appear until page 321. - 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. - 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
- Page 23 has
com.commonsware.android.Nowwhere it should havecom.commonsware.android.now(lowercase n). - Page 25 has
android.Activitywhere it should haveandroid.app.Activity. - Page 60 implies that we do our
if()test on the suppliedRadioGroup. In the code, though, we switch on the supplied radio button ID. - Page 125 has a code sample that shows calling
getLayoutInflater()on aContext. That is incorrect. For an inner class ofActivity, just callgetLayoutInflater()directly, to reach theActivity'sown implementation. - 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.
- The chapter on Notifications fails to mention that you need
Notification.FLAG_SHOW_LIGHTSin yourflagsin order to use the LEDs. - The code snippet on Page 310 is missing the second parameter in the call to
rawQuery(), which should benull. - 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
- Pages 41 and 66 have "definining" where they should have "defining".
- 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 beandroid:paddingTop. - Page 142 has "straight-foward" where it should have "straight-forward".
- Pages 224 and 263 reference
activityCreator, which has been replaced withandroid create project. - Page 293 has an incorrect screenshot, showing "Simple Preferences" for a heading when it should be "Other Preferences".
- Page 302 has "CosntantsBrowser" where it should have "ConstantsBrowser".
- Page 374 has "explictly" where it should have "explicitly".
- Page 380 has "handes" where it should have "handles".
- Page 395 has "Critieria" where it should have "Criteria".
- Pages 469 and 472 have "idiosyncracies" where they should have "idiosyncrasies".
- Page 473 has "stylii" where it should have "styli".
- Page 473 has "ANRDROID_ID" where it should have "ANDROID_ID".
Version 2.8 (digital) - November 2009
- Page 14 has "These are called br9adcast receivers", which should be "These are called broadcast receivers". The author is sufficiently mortified.
- Page 15 shows the use of a
minSdkVersionattribute in a code sample, but it leaves off theandroid:namespace prefix. - Page 20 has "There should be a new values", which should be "There should be a new value".
- Pages 109-111 demonstrate a technique for using new editions of
getTag()andsetTag()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. - 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.
- 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. - Page 224 has "add an receiver" where it should have "add a receiver".
- Page 267 has "such a widget's padding" where it should have "such as a widget's padding".
- 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)".
- 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".
- Page 359 has "or a once at install time", which should be "or all at once at install time".
- Page 374 has "To start a service, on approach is", which should be "To start a service, one approach is".
- Page 374 has "if its your own service", which should be "if it's your own service".
- Page 381 has "where you supply an PendingIntent", which should be "where you supply a PendingIntent".
- Page 390 has "You will also a permission in your application", which should be "You will also need a permission in your application".
- Page 402 has "remember to multiple the", which should be "remember to multiply the".
- Page 402 has "offers toggleSatellite(), which, as the names suggest, toggle", which should be "offers toggleSatellite(), which, as the name suggests, toggles".
- Page 415 has "navigate to spot", which should be "navigate to the spot".
- 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".
- The code sample spanning pages 457-8 is a duplicate of a previous code sample. This one should have
android:textSize="5mm" - Page 467 has "Ther are few", that should be "There are few".
- 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
- Page 16 twice erroneously refers to
android:versionCodeasandroid:versionNumber - Page 24 has "the directory where you wan the skeleton", where it should have, "the directory where you want the skeleton"
- Page 24 also has the wrong package name for the
android create projectexample. The package should becom.commonsware.android.skeleton. - Page 26 references
android.Activitywhere it should haveandroid.app.Activity. - Page 27 references using
tools/emulatorto launch the emulator, which is still true, but you need to provide an-avdswitch to name the AVD you wish to use. For more on AVDs, see the Getting Going chapter, earlier in the book. - The first bullet on page 66 has
android:layout_toRightwhere it should haveandroid:layout_toRightOf - 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).
- Page 124 indicates that
newView()should callbindView(). Actually,CursorAdapterand subclasses do that for you, sonewViw()should just return the empty row —bindView()will then be called automatically. - 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"
- Page 211 says that the
doInBackground()sleeps for "a quarter-second", when it actually sleeps for 200ms. - 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. - Page 230 has
RESULT_CANCELLEDwhere it should haveRESULT_CANCELED. - Page 252 has
R.layout.another_fieldin a code sample, where it should beR.id.another_field - The example at the bottom of Page 252, and the example at the top of Page 257, both have a redundant
xmlns:androiddeclaration. - 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"
- Page 294, in the third paragraph, refers to a "representation of the request body", where it should have "representation of the response body"
- 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"
- Page 346, in the first paragraph, refers to
getContentProvider(), which should begetContentResolver(). - Page 360 has the phrase "means that observer that initiated", which should be "means that the observer that initiated"
- Page 406 refers to a screenshot that is not in this edition of the book.
- 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.
- Page 245 has the phrase "in that the break down the SQL statements", which should be "in that they break down the SQL statements"
- 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
- Page 113, near the bottom, says "we need to add a checkbox", where it should say, "we need to add a RatingBar"
- Page 194 has "amd" in the first full paragraph instead of "and".
- 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.javainContentProvider/Constants) does not create an index. - On page 243, in the third paragraph, "in that the break down" should be "in that they break down".
- Page 245, just before the example snippet, compares this snippet to the previous snippet (on page 244) — the two snippets are actually unrelated.
- Page 274, and perhaps other places, refer to
BroadcastReceiveras being an interface. In reality, it is an abstract class. - 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."
- 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) orACCESS_COARSE_LOCATION. - Page 372 cited "previous" source code — in reality, it is referring to the Weather and WeatherPlus sample applications.
- Links throughout the book to the Building 'Droids column on AndroidGuys.com have the incorrect URL.
Version 1.9 - Early December 2008
- 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. - On page 142, the book indicates that you can only get the
ContextMenuInfo menuInfoinonCreateContextMenu(). In reality, you can also get this by callinggetMenuInfo()on theMenuItempassed intoonContextItemSelected(). - Page 180 refers to
runOnUIThread(), which should berunOnUiThread(). - The example array resource on page 231 is very wrong.
- On page 285, the third full paragraph ("The intent filter also...") should be deleted.
- Page 312 refers to
android.provider.CONTENT_URI, which should beandroid.provider.Contacts.CONTENT_URI.
Plus many others too numerous to mention — just download Version 2.0.2!
Version 1.4 - Early November 2008
- On page 96, the book refers to
contentViewwhere it should refer toconvertView. - On page 121, the book refers to a "later chapter" about threads but fails to provide a hyperlink.
- 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.
- On page 137, please ignore the backslash that accidentally was added at the end of the page.
- On page 146, the prose refers to four menu choices, when (in this version of the sample) there are actually seven.
- 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".
- 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".
- Page 259 shows a sample path to a SQLite database on the phone, but includes the
.dbextension. 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. - The last paragraph on page 302 is missing the word "than" at the end of the phrase "but by means other".
- Page 338 refers to
Parcelablewith a "(see below)" note, but there is no additional material on that interface.
Version 1.3 - Late September 2008
- 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."
- 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."
- Page 60 has three bullets, the second and third of which are repeated. The third should
actually be
android:layout_witdh="fill_parent". - 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.
- Pages 80-81 show
horizontalSpacingandcolumnWidthvalues as pure numbers, when they should be dimensions (e.g.,100px). - On pages 93, 128, and 397,
ViewInflateshould be changed toLayoutInflater. - 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.
- The third line of Page 122 shows a
0that is not in monospace font, and so may appear to look like an O. - Pages 174 and 396 refer to an obsolete
UIThreadUtilitiesclass. - 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.
- On page 229, where it says
Resources.getColor(R.dimen.forest_green), it should really sayResources.getColor(R.color.forest_green). - On pages 275, 281, and 402,
startSubActivity()should be changed tostartActivityForResult(). - On pages 275, 318, and 398,
broadcastIntent()should be changed tosendBroadcast(). - Page 287 uses
ALTERNATE_CATEGORYandALTERNATIVE_CATEGORYinstead ofCATEGORY_ALTERNATIVE, while page 288 usesDEFAULT_CATEGORYinstead ofCATEGORY_DEFAULT./li> - 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:
- On page 7, where it says there are "five key items", it should be "seven key items"
- In the chapter on Maps, in the "Drawing the ItemizedOverlay" section, the "fourth bullet" should actually be the "last bullet"
- On page 12, the second paragraph refers to
com.commonsware.androidwhere it should refer tocom.commonsware.android.searchto line up with the example shown at the top of the page - 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 - On page 60, the second paragraph refers to 16 in two places where it should be 15.
- On page 223, the bulleted list of parameters to
query()is missing theHAVINGparameter. - On page 225,
count()should begetCount(),first()should bemoveToFirst(),next()should bemoveToNext(). Also, the code example is missingresult.moveToFirst();between the query and thewhileloop to get theCursorproperly positioned, and it to has an erroneousnext()that should bemoveToNext().
Version 1.1 - August 2008
See problems #1-3 below
Version 1.0 - July 2008
- 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. - 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.
- In various places in the book, the
EditTextclass is incorrectly referred to asEditView.
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.