Errata for Android Programming Tutorials
A quick reminder: if you see problems in the book that are not listed here, report them via the Book Bug Bounty program!
ALL PUBLISHED VERSIONS: If you are using the R17 or higher version
of the Android SDK tools (and the corresponding Eclipse plugin), the instructions
for adding a JAR file to your project have changed. Simply create the libs/
directory and put the JAR in there — it will be added to your build
path automatically for both Eclipse and command-line builds.
PUBLISHED VERSIONS PRIOR TO VERSION 2.1: The Patchy example, dominating the second half of the book, uses Twitter as a data provider, but uses the older "basic authentication" model. That is being turned off by Twitter now. As such, Patchy will compile but will soon fail to run. Learn how to get your samples working despite this problem here.
4th Edition (print) - October 2011
Please note that, while the book is accurate for the Android Developer Tools that were current when the book was written, the newer Tools change various bits of the Eclipse instructions. You can find out more in this blog post.
Version 3.9 - August 2011
- The "Outside of Eclipse" portion of Step #2 in Tutorial #1 should mention that you need to have a device plugged in or a running emulator before running the
ant clean install
command.
Version 3.3 - April 2011
- The instructions in Tutorial 1 for using Eclipse do not tell you to provide a name for your application, resulting in no caption for the icon in the launcher.
- Page 14 has "if we tell Android that we do indeed those screen sizes", which is missing the word "needs" after "indeed".
- Page 159 has
MenuInflate4
instead ofMenuInflater
. - Page 172, in two places, has
getItem()
instead ofgetView()
. - Page 167, towards the end of Step #6 of Tutorial 15, says you should be able to build the app. This is a bit of irrational exuberance — the app will not compile until Step #8 is completed.
- Page 181 has "Step #1: Create an Register a Stub IntentService", where "an" should be "and".
- Page 183 has "that mirror some of the logic", where "mirror" should be "mirrors".
- Page 185 has "from the Messenger", which should be "for the Messenger".
- Page 193 refers to a "Creating a Service" chapter in The Busy Coder's Guide to Android Development, which has been replaced by two other chapters.
- Tutorial 18 has an empty "NOTE" in the introduction.
Version 3.2 - March 2011
Due to problems with the Android 2.3 emulator, and the slow speed of the Android 3.0 emulator, it is best to do the exercises with the Android 2.2 emulator. There are some instructions that are slightly out of sync with this:
- Pages 3-4 depict choosing an Android 2.3 build target — while possible, that should be a 2.2 build target for consistency
- Page 7 has
"Google Inc.:Google APIs:7"
where it should have"Google Inc.:Google APIs:8"
, again for consistency - Page 12 recommends "API Level 9" where it should recommend "API Level 8" and has
"Google Inc.:Google APIs:9"
where it should have"Google Inc.:Google APIs:8"
- Page 14 has an
supports-screens
withandroid:xlargeScreens="true"
— that attribute is not available for API Level 8, so just skip that attribute but use the rest of the element
Version 3.1 - January 2011
- Page 14 refers to the D-pad as being below the MENU button, when on current emulator skins, it is above the MENU button.
- The
RestaurantHolder
shown on Page 45 (and elsewhere) has a private data member namedrow
that is no longer being used. - Page 56 refers to an "Employing Fancy Widgets" chapter in The Busy Coder's Guide to Android Development, but that chapter has been renamed "Still More Widgets and Containers".
- Page 57 has "a EditText", which should be "an EditText".
- Many places in this book, including pages 58 and 61, refer to the "detail form", which for consistency should be "details form".
- Many places in this book, including pages 60, 61, 62, and 67, refer to "option menus", which should be "options menus".
- Starting with Tutorial #11, you need to make sure you supply an address when you add a restaurant to the LunchList.
- Starting with Tutorial #12, the
LunchList
activity is still attempting to obtain the widgets for restaurant name, etc. Those widgets no longer exist in its layout and are no longer used by the rest of the activity. You can safely remove them. - In Tutorial #18, Step #3 should mention that you need an
IPostMonitor
data member namedservice
inPatchy
. - Page 383 is missing the word "take" from "unpacking it will take a fair bit of time".
Version 3.0.1 / 3rd Edition (print) - August/September 2010
- All occurrences of "vis a vis" should be "vis-à-vis" instead.
- All occurrences of "et. al." should be "et al." instead.
- The license cited for the Four-to-Free Guarantee has an erroneous space between "Share" and "Alike".
- Page 42 refers to "drive-through" where it should refer to "take-out".
- The
RestaurantHolder
shown on Page 45 (and elsewhere) has a private data member namedrow
that is no longer being used. - Page 98 suggests that we are looking to see if a table exists before creating it, which is no longer the case.
- Starting with Tutorial #11, you need to make sure you supply an address when you add a restaurant to the LunchList.
- The third code block on page 117 is missing a line at the end:
save.setOnClickListener(onSave);
- Page 209 says "to wrap the removeCallback() in a try/catch block", when the (correct) code listing shows it is removeAccount(), not removeCallback().
- Page 290 refers to an
onBattery
object, that is really namedonBatteryChanged
. - Page 293 has "resuable" instead of "reusable".
- Page 293 has "use a WakeLock ensure PostMonitor" instead of "use a WakeLock to ensure PostMonitor".
- In Version 3.0.1, the index has an erroneous header.
Version 2.8 - June 2010
- On page 98, the sample code refers to
RestaurantSQLiteHelper
, which should beRestaurantHelper
.
Version 2.1 - June 2010
- In Tutorial #16, the first link to the identi.ca-compatible JTwitter JAR is incorrect — you can download it from here.
- The source code sample on page 174 for the
updateStatus()
method is missing a line. After creating theTwitter
object, you need to callclient.setAPIRootUrl("https://identi.ca/api");
. This statement appears later in the chapter, but it should appear here as well.
2nd Print Edition / Version 2.0 - February 2010
- On page 352, the caption to Figure 60 is the same as the caption for Figure 59. The caption to Figure 60 should be: "The very boring LunchList widget".
Version 1.9 - January 2010
- On page 40, the sample code shows the use of
R.id.name
, which in this case should beR.id.title
Version 1.1 - November 2009
- Page 16, underneath Figure 7, has "Use the directional pad (D-pad) below the [MENU] button", which should now be "Use the directional pad (D-pad) above the [MENU] button".
- Pages 38-39 show the XML for the layout for a row in the LunchList tutorial. That row has a widget (
@+id/name
) that duplicates the name in the layout for the overall activity. This is bad form and can lead to bugs. This problem gets resolved in the next tutorial, as the two same-named widgets will be contained in separate tabs and so will not conflict with each other. Future editions of this book will give these two widgets separate names. - Page 67 has
R.id.title
where it should haveR.id.name
.
Version 1.0 - June 2009
- On page xix, the link to the knol is incorrect. Click here to visit the knol in question. You may also be interested in the AndMob wiki.
- Pages 40-41 show the XML for the layout for a row in the LunchList tutorial. That row has a widget (
@+id/name
) that duplicates the name in the layout for the overall activity. This is bad form and can lead to bugs. This problem gets resolved in the next tutorial, as the two same-named widgets will be contained in separate tabs and so will not conflict with each other. Future editions of this book will give these two widgets separate names. - Page 40 mentions "three icons" that you will need to set up for your layouts. However, it fails to mention that
these need to be named
ball_red.png
,ball_yellow.png
, andball_green.png
, all located inres/drawable/
in your project. Note that the file types could be different (e.g., JPEG instead of PNG), but the base names (e.g.,ball_red
) are important. - Page 98 should include a code listing for the new
populateFrom()
method onRestaurantWrapper
. You can find this code on page 105-106. - Page 98 also shows
newView()
populating the row. That is not necessary —bindView()
will be called afternewView()
on the row returned bynewView()
. Hence, allnewView()
needs to do is inflate the row. - On page 148, the name of the
onRetainNonConfigurationInstance()
method is missing the "Non" part.
Version 0.9 - April 2009
- On page 191, the tutorial indicates that the local service is a singleton, "accessible from a static method on the service class". Actually, it is only a public static data member on the service class.