Errata
The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".
The following errata were submitted by our customers and approved as valid errors by the author or editor.
Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update
Version | Location | Description | Submitted By | Date submitted | Date corrected |
---|---|---|---|---|---|
Printed | Page 20 "Sources (under src)" paragraph |
The Package name being discussed is "com.oreilly.helloworld", but here typo as "com.android.helloworld" Note from the Author or Editor: |
Puneetkr | Jun 10, 2009 | |
Page 21 2.1.1 (Creating an Android Developement Environment) - 2. (Install Eclipse) - Linux and Mac OS X |
Eclipse/Android SDK buggy when user does not have write permissions to installed directory tree. A fix is to install both Eclipse and the Android SDK to the user's home directory. (I used "/home/myname/local/eclipse" and "/home/myname/local/android-sdk/"). Note from the Author or Editor: |
oblongata | May 25, 2009 | ||
Page 23 Topic 6.d. Install the Android plug-in (ADT) |
Stale URL for Eclipse Android Plug-in ADT "https://dl-ssl.google.com/android/eclipse" is no longer valid. It seems to have been replaced by "http://dl-ssl.google.com/android/eclipse/site.xml" Phooey on Google for another catastrophic undocumented change. Cheers to you guys at ORA for trying to keep up with the radical SDK changes. Note from the Author or Editor: |
oblongata | May 25, 2009 | ||
Printed | Page 35 Boxed example |
I am stumbling from the gate, having trouble to load and start the main MJAndroid example. On page page 35, the books says I should execute: $ emulator $ adb install MJAndroid-1.0.0.apk It didn't work literally. Instead I had to do (in android SDK's tools directory): $./android create avd --target 2 --name my_avd $ ./emulator -avd my_avd Then I downloaded MJAndroid.apk (I could not find MJAndroid-1.0.0.apk file from the website), and copied it to the tools directory. Now I issued $./adb install MJAndroid.apk But I get the following error message: 2028 KB/s (69445 bytes in 0.033s) pkg: /data/local/tmp/MJAndroid.apk Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY] ??? I wish the book had a clearer instruction even for newbies, at least for the main example. Note from the Author or Editor: |
Sy | Jun 10, 2009 | |
Printed | Page 35 Boxout 'Running the MJAndroid code' |
PS - I'm aware you responded to oblongata's report of this same issue with a pointer to Google's page about AVDs, but the problem still occurs using either a version 1 or version 3 AVD (your response didn't make it entirely clear which was more appropriate). I've spent days messing with different versions of AVD, different versions of the SDK, and trying to find the older version of the ADT. Can you please provide readers with an *exact* list of the most recent software - AVD device version, SDK version, ADT version, along with instructions to get the MJAndroid to run? We paid good money for your book. This is incredibly frustrating. Note from the Author or Editor: |
Anonymous | Jul 18, 2009 | |
Page 36 3.3 (Downloading the MJAndroid Code) |
The downloaded tarball at http://www.oreilly.com/catalog/9780596521479 contains the R.java file in the src/ tree, "src/com/microjobsinc/mjandroid/R.java", it should not. This file should be built by the ADT. The reason being is because the later SDK's will build R.java to the gen/ tree "gen/com/microjobsinc/mjandroid/R.java". When the ADT builds R.java to the gen tree, the build then fails if there is an existing R.java in the src tree. A quick fix is for the user to delete R.java from the src tree. Note from the Author or Editor: |
oblongata | May 25, 2009 | ||
Page 43 3.5.2 Loading and Starting the Application |
Note: Project builds and installs to emulator, but terminates on runtime error, “The application com.microjobsinc.mjandroid (process com.microjobsinc.mjandroid) has stopped unexpectedly. Please try again. [Force close]” CODE WARNINGS RECIEVED: src/com/microjobsinc.mjandroid/EditJob.java: import com.microjobsinc.mjandroid.MicroJobsDatabase.JobsCursor is never used src/com/microjobsinc.mjandroid/MicroJobs.java: onCreate(Bundle): local variable myLocation is never read. src/com/microjobsinc.mjandroid/MicroJobsList.java: import android.app.AlertDialog is never used import android.content.DialogInterface is never used import android.os.Handler is never used import android.os.Message is never used (my development environment: IDE=eclipse-jee-ganymede-SR2-linux-gtk-x86_64 SDK=android-sdk-linux_x86-1.5_r1 (2009-04-22) Platform=1.1, API-level=2 ) Note from the Author or Editor: |
oblongata | May 25, 2009 | ||
Page 43 3.5.2 Loading and Starting the Application: Running the MJAndroid Code |
The text says to use the prebuilt apk (which is correctly signed) if we wish to run the application, and to read Chapter 7 if we wish to learn how to sign then run our own built code. However, the prebuilt .apk is misnamed. The text refers to it as MJAndroid-1.0.0.apk, the correct name is MJAndroid.apk. The text also neglects to give the exact URL from which to acquire it (and there are several same-named files in different "examples" tarballs). The tarball that worked for me was: "http://examples.oreilly.com/9780596521479/example_android_2009_02_08.tar.gz", and not the one in "http://examples.oreilly.com/9780596521479/MJAndroid.zip". There is another tarball in that same directory with a similar name "http://examples.oreilly.com/9780596521479/example_android.tar.gz". But this tarball does not have any MJAndroid.apk. If you were to consolidate the tarballs, removing any extraneous files, it would greatly assist the reader in following code examples. Note from the Author or Editor: |
oblongata | May 25, 2009 | ||
Safari Books Online | 43 Section 3.5.2 |
Hi there, I have read the previous errata submissions and followed the AVD web page instructions for 1.5. I have two AVDs, one for the first Note from the Author or Editor: |
Lee Crampton | Aug 19, 2009 | |
Safari Books Online | 43 3.5.2. Loading and Starting the Application |
Section 3.5.2 (about how to get the sample MJAndroid app running) explains there is a problem with the Map api key. The example application will not run unless it is fixed. The text suggests a method to fix it with loading materials from the samples. (MJAndroid-1.0.0.apk) In the errata other readers have noted that there is the confusion of several examples with different names in the directory listed. Also most of the examples don't have the file indicated. One reader said he found it under another name. (MJAndroid.apk) The problem persists. I could not even find the file under the new name. I think I downloaded every example. Mistakes happen but it is hard to understand why these easy-to-fix problems would still be there after all the reader comment???? I suggest you get a clean version of the needed file with a name that matches the text out in the clear (not embedded in compressed files). thanks Note from the Author or Editor: |
Anonymous | Aug 16, 2009 | |
Printed | Page 47 2nd Paragraph, just under the first first code segment |
There is a minor typo in the bundle name Note from the Author or Editor: |
Mike | Aug 09, 2009 | |
Page 52 4th Paragraph |
Note from the Author or Editor: |
oblongata | May 26, 2009 | ||
Page 54 last paragraph (code listing) |
The text declares longitude and latitude to be of type double. But the source code downloaded from examples declares them as type int. Also, your text is referring to the Bundle as savedInstanceState, whereas the actual source code still uses the old SDK name icicle. (A minor difference I know, as long as the naming's consistent. But this might confuse new programmers.) Note from the Author or Editor: |
oblongata | May 27, 2009 | ||
Page 67 3rd paragraph |
Hard returns at parentheses surrounding adb: Android Debug Bridge ( adb ) Instead of just: Android Debug Bridge (adb) Note from the Author or Editor: |
oblongata | May 28, 2009 | ||
Printed | Page 67 bottom |
The solution to the substring problem is not quite true: you state that people assume the substring call to have the number of letters as a parameter. Even then, substring(0,6) would be wrong. The actual problem is that the second parameter does not denote the last character but the one BEHIND the last one. Greetings, Christian Note from the Author or Editor: |
Anonymous | Jul 19, 2009 | |
Page 71 Fig 5-3 (main.xml in Eclipse) |
file contents in the figure is totally different than that of the file in "http://examples.oreilly.com/9780596521479/example_android_2009_02_08.tar.gz" The tarball example file is listed below (note: RelativeLayout instead of Linear, as well as no WebView section.) <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffc5d1d4" > <com.google.android.maps.MapView android:id="@+id/mapmain" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="0EHPt9AwkePFgASSLmLJYWuD3aw7d_h1vWNE66A" /> <TextView android:id="@+id/lblMicroJobsToday" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="MicroJobs for You Today Near:" android:textSize="20dp" android:textColor="#FF000000" android:layout_centerHorizontal="true" android:gravity="top" /> <Spinner android:id="@+id/spnLocations" android:layout_width="250dp" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginTop="2dp" android:layout_below="@+id/lblMicroJobsToday" /> <Button android:id="@+id/btnShowList" android:layout_width="150dp" android:layout_height="wrap_content" android:text="List Jobs" android:textSize="20sp" android:gravity="center_vertical" android:layout_centerInParent="true" android:layout_alignParentBottom="true" /> </RelativeLayout> Note from the Author or Editor: |
oblongata | May 30, 2009 | ||
Page 83 heading of 3rd full paragraph |
unnecessary hard returns around Note from the Author or Editor: |
oblongata | Jun 01, 2009 | ||
Page 83-85 Throughout pp83+84, top of p85 |
unnecessary hard returns around Note from the Author or Editor: |
oblongata | Jun 07, 2009 | ||
Page 84 First paragraph |
The book describes several command line options to adb, in particular how to read the radio and events logs. The version of ADB I'm using (v1.0.20) does not accept the referenced options: adb -b radio adb -b events However, interfixing the statements with "logcat" renders the desired results: adb logcat -b radio adb logcat -b events Note from the Author or Editor: |
oblongata | Jun 07, 2009 | ||
Page 88 Sect 5.2.6.1 Trace data collection (top of page) |
Adding "-sdcard filename" to "Window->Preferences->Android->Launch" did not map the mksdcard created image to the emulator. I had to: Window->Android AVD Manager Then delete the AVD I had created at an earlier step, then recreate it but specify the sdcard size. Because Eclipse/IDE will not allow the addition of an SD card after creation, I had to delete, recreate. #################### Also note the the x.trace file created does NOT contain any data (file size is zero): -rw-r--r-- 1 username username 0 2009-06-11 00:08 x.trace Consequently, none of the Traceview techniques mentioned in this section render the desired displays. When entering "traceview x.trace", "Key section does not have an *end marker" error message results. Note from the Author or Editor: |
oblongata | Jun 10, 2009 |