Errata
The errata list is a list of errors and their corrections that were found after the product was released.
The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.
Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update
Version | Location | Description | Submitted by | Date submitted |
---|---|---|---|---|
example 7-8 Note 8 |
Example 7-8 never sets the text color to yellow and the text never appears as green because the text color is immediately set to red or defaultTextColor in the following lines. |
Darryl Gough | Feb 04, 2014 | |
Printed | Page 1 Everywhere |
I think it is worth mentioning in the book that eclipse offers a javadoc window which can be used to view details about classes, method and so on. For instance on page 107 of the book START_STICKY is returned as mentioned in another errata entry, information about this can be viewed if you click on it and view the details in the javadoc window! |
Anonymous | Sep 06, 2011 |
Page 16 2nd paragraph under "Setting Up a PATH to Tools" |
Author directs readres to step 2 in the document "Installing Android SDK" for instructions on configuring PATH variable. Actual instructions are presented in the step 5 of the document. |
Aleksandar Dragosavljević | Jun 30, 2011 | |
Page 29 Figure 4-1 |
1.The "Stopped" on right side should be "Paused".(confirmed) |
yizhi | Dec 01, 2011 | |
Printed | Page 60 Adding the jtwitter.jar library |
Have been unable to download and install the modified winterwell with success. Printed description does not apply since download file format has changed. There is no accompanying readme file that says what to do. Closest I have come is by using File/Import function which left my with a JTwitterYamba package that has 79 compile warnings. (??) |
Steen Hess | Nov 28, 2011 |
Printed | Page 68 Section 2 |
Eclipse flags the |
Phil Ringsmuth | Sep 29, 2011 |
81 3rd paragraph |
"Hierarchy Viewer allows you to attach to any Android device, emulator, or physical phone and then introspect the structure of the current view. ..... You can introspect not just your screens, but the screens of any application on your device. This is also a good way to see how some other applications are structured." |
Leon | Jul 22, 2012 | |
86 United States |
extra attribute in the edittextpreference element for password. Where did this come from? The instructions don't mention it. It ends up being an 'unknown xml attribute' in the developers view of prefs.xml |
Kevin | Nov 07, 2011 | |
Printed | Page 87 Example 7-2 |
How do I get around the problem that addPreferencesFromResource(R.xml.prefs); is deprecated? |
Carl-Gustav Nyman | Mar 13, 2013 |
Printed | Page 95 Third Paragraph |
The code snippet is meant to demonstrate where the new 'Twitter' singleton is utilized to send a status update. The call is shown within the 'onClick()' method and is executing a blocking call directly to Twitter, but the accompanying text suggests that we are using the 'PostToTwitter' async inner class. The code snippet should show the 'getTwitter().setStatus(..)' being called within the 'doInBackground()' method in this inner class. This is exactly what the downloadable example code shows, so I think it was just a mistake when producing the text... :-) |
Nick DiPatri | Jul 16, 2011 |
Page 95 first paragraph |
The text reads that the onClick method requires updating and shows the updated onClick method. However, the onClick method doesn't set the status. It does this: |
Anonymous | Aug 09, 2013 | |
Page 98 Last paragraph |
The statement, "I usually compare it to finding someone's laptop on the street," seems to be a false analogy. Reading clear text data off of a hard drive is much easier than reading data off of a phone's internal storage, at least if the phone is password-protected. |
Anonymous | Nov 01, 2011 | |
Printed | Page 103 Code listing |
the use of this in when referring to twitter is not required and serves no purpose. |
Anonymous | Sep 03, 2011 |
Printed | Page 103 Code listing |
The class is defined as YambaApplication1 however in other places it is used as just YambaApplication. |
Anonymous | Sep 03, 2011 |
Printed | Page 111 Listing |
The code does not in anyway control the updater as a singleton. I can see no reason for having multiple updaters. It would be better if the code defined updater as a static on the UpdaterService2 class and provided access to this via getter and setter methods. This way the runFlag is not required and there will only ever be one updater thread. The onStartCommand should check if updater is null and only create the thread if it is. |
Anonymous | Sep 06, 2011 |
Printed | Page 114 application listing |
As I mentioned in my errata on page 111 and the use of a static within the updater this could be used by the application class and then the isServiceRunning method could just return UpdaterService2.updaterRunning(). This makes the code so much clear, resolves various threading issues, makes sure a singleton pattern is in place and also removes the need for a flag in the application and the setServiceRunning() method. |
Steve Webb | Sep 06, 2011 |
Page 121 First paragraph |
The text says, "these four items will be the columns in our schema, along with a unique ID for each tweet." But only three columns (created_at, txt, user) are in the list immediately prior. Perhaps the "source" column was supposed to be listed as well? |
Anonymous | Nov 02, 2011 | |
Page 121 3rd full paragraph |
"when we need to use SQL" should be "where we need to use SQL" |
Anonymous | Nov 02, 2011 | |
Printed | Page 123 code listing |
It seems strange that SQLiteOpenHelper is an abstract class and stores the context but doesn't provide a method to be used by a subclass to get it! Is this typical of the way android SDK classes are put together? To me with 15yrs of OO experience I'd view it as a glaring design bug. |
Anonymous | Sep 15, 2011 |
Page 123 example 9-1 |
static final String C_TEXT = "txt"; |
Tareq Jahhaf | Feb 27, 2012 | |
Page 126 inside the foreach loop |
db.insertOrThrow(...) should be db.insert(...) |
Danny Sun | Jul 26, 2011 | |
Printed | Page 126 timeline loop |
As you have a DbHelper class it would strike me as good OO practice for this to be the place to provide a method to insert new status information into the database. As it is you make use of public attributes of the DbHelper class which strikes me as a strange thing to do as it still allows the wrong type of data to be inserted into the table and only to be found when running the app. If a method with the correct signature for the vales was provided the only option would be to supply the correct data types. Also of course this would encapsulate the database logic. |
Anonymous | Sep 16, 2011 |
Page 126 example 9-2 |
in function run, inside the for loop |
Tareq Jahhaf | Feb 27, 2012 | |
Page 126 example 9-2 |
in the function run, inside the for loop |
Tareq Jahhaf | Feb 27, 2012 | |
Page 127 para "Verify that the database was created" |
Examining the database file as suggested is not possible when using real hardware unless it's 'rooted'. adb shell, File Explorer View etc are subject to UNIX file permissions 'other', and /data/data and other related fies and directories are usually mode 0771. |
Patrick Middleton | Oct 17, 2012 | |
Printed | Page 130 First sentence |
It says change insert to insertOrThrow however the code listing it is talking about on page 126 already made use of insertOrThrow not insert. |
Anonymous | Sep 22, 2011 |
PDF, Other Digital Version | Page 130 1st paragraph |
The 1st paragraph says you should replace db.insert() with db.insertOrThrow() however the source code on 126 already uses db.insertOrThrow(). |
Jonathan Bullock | Feb 11, 2012 |
Page 130 example 9-3 |
in the last line |
Tareq Jahhaf | Feb 27, 2012 | |
131 Example 9-3, Note 7 |
The call to SQLiteDatabase.insertWithOnConflict() in StatusData.insertOrIgnore() is an API Level 8 function. |
damok | Jul 09, 2011 | |
Printed | Page 131 insertOrIgnore method |
The dbHelper has a close() method but you actually call db.close in the finally clause. This does not strike me as a very well structure bit of programming. |
Anonymous | Sep 22, 2011 |
Printed | Page 132 2nd paragraph |
Comment reads: |
Anonymous | Jul 14, 2011 |
Page 132 the comment of the 2nd block of code |
/** |
Tareq Jahhaf | Feb 27, 2012 | |
Page 133 example 9-4 |
I think you should add this line of code to function onCreate() in YambaAppication (example 9-4) |
Tareq Jahhaf | Feb 27, 2012 | |
Printed | Page 134 Code listing |
The code refers to Status and no longer Twitter.Status. This implies that the class now statically imports Twitter but this is not mentioned anywhere in the book as far as I can see. |
Anonymous | Sep 22, 2011 |
Page 134 example 9-4 |
inside the for loop |
Tareq Jahhaf | Feb 27, 2012 | |
Printed | Page 134 At the end of example 9-4. |
At the end of example 9-4 there is a Log.d which makes the application write a log row 'Got X status updates'. This row is written everytime the service runs the method fetchStatusUpdates() and is then written as 'Got 20 status updates'. That is, the application always considers all 20 fetched statuses to be new even if they are not. |
Carl Rehnstedt | Dec 16, 2012 |
Printed | Page 138 2nd para |
The book introduces the timeline activity and gives xml and code for a version using a text view, it then basically says this isn't a good way of doing it and never gives a complete implementation so that atleast you can see the code working and listing out the tweets in the text view. This is most annoying if you have just entered all the code and created a new screen. Personally I went ahead and made the refactoring changes mentioned a few pages later to add the menu's so that I could atleast see it working before refactoring to use the adaptor. I think the order should be changed so that the code using the textview can be seen to be working and then introduce the better alternatives when the menu and start/stop service are already available on the timeline activity. |
Anonymous | Oct 07, 2011 |
Page 138 4th paragraph |
the line before the last one typo : |
Tareq Jahhaf | Feb 27, 2012 | |
Printed | Page 138, 140 bottom of p. 138, top of p. 140 |
Example 10.1 at the bottom of page 138 shows a file called res/layout/timeline_basic.xml , but the code at the top of page 140 (in example 10.2) refers to timeline: |
r. clayton | Jul 18, 2013 |
Page 139 Example 10.2 - source code of TimelineActivity.java, version 1 |
In chapter 9, StatusData class has been created to encapsulate and hide database-specific details from the rest of the application. |
Anonymous | Nov 01, 2011 | |
Printed | Page 140 First paragraph - onCreate(), onResume() |
The material in chapter 10 (List and Adapters) is inconsistent with the refactoring made at chapter 9, so the examples would not compile, as they use DbHelper directly, rather than using the code refactored to statusData. |
Ron Munitz | May 11, 2012 |
Printed | Page 145 TimelineActivity.java |
I have got the impression that in chapter 9 we embedded class DBHelper into StatusData. But chapter 10 still uses DBHelper directly instead of taking advantage of the new class StatusData. I've deleted DBHelper.java in chapter 9, so all direct references to it need to be changed. Also instead of using here db.query . . . we have now getStatusUpdates(), which gives you directly what we need to use. Hope this helps. I like the book a lot. |
Jorge Sanguinetti | Apr 22, 2012 |
Page 152 Example 10-10 |
This throws an exception if the preferences have not been created yet, i.e., the first time the application is run before filling in the preferences: |
Anonymous | Dec 19, 2011 | |
Page 154 1st paragraph |
onPrepareOptionsMenu() is a much better choice here than onMenuOpened() to dynamically modify the contents |
Patrick Middleton | Oct 23, 2012 | |
Printed | Page 154 Example 9-8 |
When handling R.id.action_tweet in onOptionsItemSelected(), it tries to issue implicit intent (or that's what it looks like: it passes the string "com.marakana.android.yamba.action.tweet"); but this intent isn't hooked up to anything; if you click the "tweet" button, the application crashes. |
George Dunlap | Apr 09, 2014 |
Printed | Page 155 Middle of page |
Several new menu options have been added without discussion. Also, use of Intent Flags is introduced throughout without discussion as to what they are or how they work. The book overall has been very good with explaining key points as they are introduced, so this looks like an oversight. |
Anonymous | Jun 04, 2011 |
Page 157 TimelineActivity code |
Both fetchStatusUpdates() in YambaApplication.java and setupList() in |
Marcel H | Jul 30, 2011 | |
Page 157 latest code |
At the end of chapter 10 we still depend on the DbHelper.java file because TimelineActivity and TimelineAdapter are still using the database column name strings from that file. |
Marcel H | Jul 31, 2011 | |
Printed | Page 157 |
This was previously reported as minor technical mistake on page 152 however the error propagates through the rest of the chapter and shows up again on page 157. The variable 'yamba' is never declared nor initialized and yet many parts of the code have been refactored as if it had. I'm adding this again as it seems the serious errors tend to get more attention from the author to add an explanation (and I believe it is a serious error). |
Anonymous | May 21, 2012 |
Page 158 Second to last paragraph in the last sentence. |
The excerpt "functional concerns among BaseActivity, StatusDate, and TimelineActivity" should read "functional concerns among BaseActivity, StatusData, and TimelineActivity". |
Brandon Blincoe | Dec 14, 2012 | |
Page 162 2nd paragraph |
"which in turn will launch our TimelineActivity activity" should read "which in turn will launch our UpdaterService service." |
Anonymous | Nov 14, 2011 | |
Printed | Page 164 Listing 11-5 |
The code makes use of an attribute 'receiver' in the call to registerReceiver(receiver, filter) however no explanation is given as to what receiver is. Obviously it is an attribute assigned a new instance of TimelineReceiver but that has not been shown or described in the book! |
Steve Webb | Oct 11, 2011 |
PDF, Other Digital Version | Page 164 code example: registerReceiver(receiver, filter); |
I am getting an error of "receiver cannot be resolved to a variable". We have never declared/instantiated a "receiver" variable. |
Sean Harrop | Oct 22, 2011 |
Page 164 Example 11-5 |
registerReceiver(receiver, filter); |
Cullen SUN | Mar 28, 2013 | |
Printed | Page 169 No where! |
There is no where in this section of the book that describes how we test the code which checks for data connection lost! It didn't seem to work for me using the emulator and going into airplane mode. |
Steve Webb | Oct 11, 2011 |
Printed | Page 177 first code listing |
The definition of uri content uses yamba7, this really should be yamba or maybe yamba1. The use of numbers through out the entire book is inconsistent and has causes lots of compilation errors or runtime errors that I have not raised here. |
Steve Webb | Oct 12, 2011 |
Page 177 last Paragraph |
nubber (3) |
Tareq Jahhaf | Feb 27, 2012 | |
Page 182 4th full paragraph |
Should say "AppWidgetProvider" instead of "AppWidgetProviderInfo". |
Anonymous | Nov 16, 2011 | |
Page 185 example 12-3 |
inside <LinearLayout> |
Tareq Jahhaf | Feb 27, 2012 | |
Printed | Page 195 Point 2 |
It says that the compassrose.jpg is in the drawable folder. I downloaded the source code (I typed everything in prior to this!) and the jpg isn't there, also there doesn't appear to be any code for the compass demo. |
Steve Webb | Oct 17, 2011 |
Page 210 1st paragraph |
entities and entity instead of entries and entry are used in three places as follows: |
Emerson Wang | Nov 11, 2011 | |
211 No where! |
I downloaded the source code and I've noticed the widget in Yamba-8 does not get updated. The problem is that the manifest does not have the correct filter set for the update, it should be |
Steve Webb | Oct 17, 2011 | |
Page 213 sendTimelineNotification() |
A Notification typically contains "tickerText", so that when the notification shows up, the icon and the tickerText show up briefly, and then the icon remains in the notification area. |
Jaewook | Jan 26, 2012 | |
Printed | Page 221 Remote Client Intro |
The AIDL files are needed by the client, I understand this as they are the definition of the interface with the service. However I do not understand how requiring a copy of the message.java class in the client makes good sense! Surely this can lead to all sorts of issues with versioning? |
steve Webb | Oct 19, 2011 |
Printed | Page 231 4th paragraph (the JNI Header file) |
The classpath setting in the page is wrong, as the classpath required for the javah is |
Ron Munitz | May 12, 2012 |
Other Digital Version | 2296 1st two paragraph |
Hi, |
naeem khan | Jun 25, 2011 |