By Developers, For Developers

Historical errata for Hello, Android

PDF PgPaper PgTypeDescriptionFixed onComments
999SUGGEST

This is a test of the bug tracker. Please ignore.

2008-05-12
43ERROR

The code example 3.4 which shows the layout for the improved buttons with font change, and background color had the attribute android:background=“@string/background” and I get an error that this is not defined? I looked around on nearby page to see if it is defined in another snippit but I can’t find it. Am I just not seeing it?

2008-05-12
61SUGGEST

I download the sourcecode for the Graphics class. Code is cool but as any android developer knows the android app is much more than class code - specifically I think that really the whole of the application package needs to be available for readers to download so that they don’t have to either recreate XML layouts or resources. I expect you’ve thought about this and for the actual book there will be an online zip or a svn uri to connect to. maybe even an accompanying CD/DVD which would negate this whole issue.

2008-05-29
30TYPO

In the best practices box, “The development of object oriented languages allowed the data and the code to access it into objects.” should probably be something like: "The development of object oriented languages allowed the data and the code to access it to be bundled together into objects.

2008-05-29
49SUGGEST

On pages 48 and 49 of the PDF there is a description of defining intents using Eclipse. I think in addition to this it would be helpful to show the resulting XML code in the AndroidManifest.xml.

2008-05-29
19TYPO

1.3 Running A Program

- last sentence, 1st para.

… The first time you do this it may a minute or two …
^

2008-07-24
10TYPO

The second paragraph ends with two periods.

2008-07-24
55TYPO

The text expects the New Game button to work, but an OnClickListener is never added to newButton to call openNewGameDialog().

2008-07-24
61TYPO

should be x=150, y=150, radius of 100.

2008-08-29
34ERROR

Android version 0.9 has been released, this book has not been updated with the necessary changes specified here: code.google.com/android/migrating/m5-0.9/changes-overview.html] For example, I get many errors when I try to run the Sudoku V4 example in Eclipse with the latest Android release. I’m sure this book will be updated by the time it goes to press, but I just wanted to let you guys know in case the update slipped under your radar.

Thanks for a great book!

2008-08-29
27TYPO

it can running

2008-09-27
46ERROR

In this line of example code:
aboutButton.setOnClickListener(new OnClickListener() {

I believe that should be:
aboutButton.setOnClickListener(new View.OnClickListener() {

2008-09-27
46ERROR

When I try and write this program, I get a very confusing error which is not really addressed in the book. You don’t ever tell users to import all the necessary libraries you are using. I found them in the sample Sudokuv1.java file, but the book never once mentions to include them.

2008-09-27
45SUGGEST

A caveat when using the new Android Resource editor (with Android 1.0/Eclipse plugin 0.8 ) is that the italic text in the about_text is escaped, which will cause your text to show the i-tags rather than making text italic. This can be solved by using the source editor.

2008-09-27
111TYPO

2nd bullet: “or and under-powered browser” -> “or an under-powered browser”

2008-09-27
141SUGGEST

regarding the “Joe asks…”: To make it a little easier to work with static imports, two tips:

  • Under Preferences > Java > Code Style > Organize Imports, set "Number of static imports needed for .* to 1. This means that once you’ve imported once method/constant statically, all other elements from that same class become available easily.
  • After including the first method/constant you’d like to have imported statically (e.g Math.sin()), use Cmd-Shift-M (on the Mac; probably Ctrl-Shift-M elsewhere) or Source > Add Import, which then includes the static import, and the entire class (import static java.lang.Math.*) if you’ve followed the first suggestion.
2008-10-24
52ERROR

The strings in the strings.xml definitions are missing. You should at least mention that they need to be added.

options_label,cancel_label are the ones.

2008-10-24
54TYPO

for the difficulty selection dialog, the newButton listener has to be added to setListeners(). That code is missing. I added:

\t\tnewButton.setOnClickListener(new OnClickListener() {
\t\t\tpublic void onClick(View v) {
\t\t\t\topenNewGameDialog();
\t\t\t}
\t\t});

I wasn’t sure if this is the right way to bring up a dialog, maybe there should be a Activity involved?

2008-10-24
72ERROR

In the code download a Keypad activity is cited. There is description for that in the text. I would expect it somewhere around the input section. Or is that a leftover?

2008-10-24
43TYPO

The example text for layout_width/layout_height near the end of the page looks funny. The “fill_parent” attribute values are half in proportional font, half in serifed italics, with a small “p”.

2008-11-06
46TYPO

The XML listing here shows android:orientation=“horizontal”. I’m pretty positive this is supposed to be “vertical” instead.

2008-11-06
30ERROR

Figure 2.3 on page 30 shows incorrect sequence of method calls between the Stopped and Running states. Specifically, it shows (1) onStart() (2) onRestart() (3) onResume().

I believe the correct sequence should be (1) onRestart, (2) onStart(), (3) onResume().

The JavaDocs in the Android SDK’s onRestart() method are inconsistent on this matter, which probably explains where you got the sequence.

If you study Activity.java from the actual Android SDK source, you’ll see that the final void performRestart() method actually calls callActivityOnRestart(this) followed by performStart(). This is also consistent with other parts of the SDK JavaDocs that say performRestart() is always followed by performStart(). Search for the text “always followed by ” in the SDK source for Activity.java and you’ll find what I’m talking about.

2008-11-06
90ERROR

one small item…

“When the player select one of the buttons on the keypad it calles the returnResult() method with the index of the button.”

you should replace “index” with “index +1” or the “value of the key”

2008-11-18
58TYPO

The additional strings needed for the settings are duplicated on PDF page 58 and 60.

2008-11-18
98TYPO

“add some fireworks when the playser solves the puzzle”

Should be “player”

2008-12-04
206ERROR

Missing code before cube.draw(gl) in drawFrame()

The cube is at this point not visible without doing something like:

gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glTranslatef(0, 0, –3.0f);

2008-12-04
30TYPO

“Called when the activity first starting up.” should probably be “Called when the activity is first starting up.” or “Called when the activity first starts up.”

2008-12-04
1ERROR

Code example for the Android book don’t render on a G1. The textures don’t comply with the spec, android.png is 90x90. It should be a power of 2. 64x64 or 128x128.

2008-12-04
34ERROR

The line reading

should read

2008-12-04
19TYPO

Project Name is “Hello” on page 19, but is “HelloAndroid” in a picture on a page 20.

2009-05-26
24TYPO

In this sentence:
“The Android phone user will never see Linux, and your programs will not make Linux calls directly.”

The comma is not necessary.

Ciao!

2009-05-26
63ERROR

The KEY_DIFFICULTY String is defined as “difficulty”, which is used as the name parameter when calling Intent.putExtra(name, value).

However, the javadoc for Intent.putExtra says, ‘The name must include a package prefix, for example the app com.android.contacts would use names like “com.android.contacts.ShowAll”’

2009-05-26
6, 7ERROR

This is reasonably minor, but “Window > Preferences” does not exist on the Mac OS X version of Eclipse 3.4. Preferences is under the Eclipse application menu. I didn’t have too much trouble finding it, but it might be worth noting it in the book.

2009-05-26
142SUGGEST

Not to be a stickler, but English is a Germanic language. Only languages that descend from Latin are Romance languages.

2009-05-26
43ERROR

In chapter 3, the Sudoku.java file gives me errors that the “R.menu cannot be resolved” for this method:

@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
——————————

Then I get “R.id.settings cannot be resolved” for this method:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.settings:
startActivity(new Intent(this, Settings.class));
return true;
// More items go here (if any) …
}
return false;
}


Please advise.

Thanks,
KS

2009-05-26
134ERROR

You say use-permissions go before (Manifest)

on page 146 you say after

2009-05-26
10OK

The PDF’s sidebar displays this section and its entries as “FLAGCOLOR ”. I’m viewing this PDF using the Mac Preview app.

2009-06-19
133TYPO

VIEW_ACTION should be ACTION_VIEW in the sentence below. “The next line creates a new Intent class with an action
of VIEW_ACTION, passing it the Uri class just created as the object we want to view”.

2009-08-04
163OK

status, not S[status] in the log stmt.

public void onStatusChanged(String provider, int status,
Bundle extras) {
log(“\
Provider status changed: ” + provider + “, status=”
+ S[status] + “, extras=” + extras);
}

2009-08-04
233TYPO

Simple typo, last line of the section just before “C.3 Publishing” it says “you’ll have a ..apk file” where there should be only one period (although I would suggest using ‘an’ as well instead of ‘a’ the style is up for debate, especially when it is not known whether the ‘.’ is pronounced or not).

2009-08-13
238SUGGEST

Page 238 is the first page of the index, and has references to page numbers with an ‘f’ after them. It is not explained, but I assume these are for figures…? Additionally, they are not hotlinked like the page numbers and sometimes occur before and sometimes after (or both, as demonstrated by the entry for ‘About box’).

235TYPO

“Regardless of the change, you must click the Publish button for your changes to be visible to Android Market users. If you click Save instead, changes be kept in draft form until you finally commit and click Publish.”

Second sentence seems to be written in Pirate-English!! “…changes be kept in draft form…” should probably read “…the changes will be kept in draft form…”, although I do kind of like the style!

2009-08-13
91TYPO

Extra comma in the code for the array c[]… note the trailing “,” prior to the “};”

int c[] = { getResources().getColor(R.color.puzzle_hint_0),
getResources().getColor(R.color.puzzle_hint_1),
getResources().getColor(R.color.puzzle_hint_2), };

79ERROR

The line of code

setTitle(R.string.keypad_title);

is missing from the Keypad onCreate method. It should be the first line of code printed on page 79. Without it the keypad appears with an empty title.

102ERROR

The Music class’s stop method takes a Context object as a parameter, but that object is never referenced in the body of the method.

121ERROR

The end of section 7.1 needs to include adding the internet permissions to the AndroidManifest.xml in order to run (just like is mentioned on page 124 for section 7.2).

154TYPO

Text at the bottom of the page is hidden by the footer.

51TYPO

Source code for strings.xml has comments located at the very top above starting “” line. Such XML file cannot be compiled; comments should be placed below “” line.

128ERROR

The download code sample on page 128 contains a technical error: package org.example.video; should be package org.example.sudoku;

ylgHUwdlUEERROR

Page views or unique viiotsrs are bad measurements because they focus on abstract metrics instead of the valuable customer behavior that generates those metrics.So, they focus on the check they get at the end of each month, instead of the reason why they get that check. 1 million page views might mean 1 million dollars, but if you’re not converting any users, then next month, you might not make a dime.I’ve been trying to push a meme at work around behavior-driven metrics’ with the gist being you have to measure the user behavior that drives the money.So, for a site at work, the business model relies on return viiotsrs. Where the business wants to focus on unique viiotsrs per month, I’m trying to push them to focus on return viiotsrs per month.It seems like an obvious answer to me, but in the end, the business is on the hook for delivering so much money a month. The end-all, be-all for most of the business side will be a metric that tells them how much that check will be.So, my latest thinking is to go for a compromise: track engagement (the user experience) and monetization (the business success).* page views per session (engaged) AND ad views per session (monetization)* video ends (user engaged) AND ads views per video (video monetization)* return viiotsrs per month (engagement) AND ad views per return visitor per visit (monetization)This is still a problem I’m working through, so I’m kind of thinking out loud here I think number of clicks is better than time on site, but the best metric measures the user behavior you believe is critical to the success of your business model.Is that number of uploads? Do you believe uploads drive the referral traffic that’s key to your ad revenue?Is the key behavior number of registrations? Number of slideshow starts? Slideshow completions?Time on site, number of clicks, unique viiotsrs, whatever. None of those matter if none of them contribute to what makes your business run.

63ERROR

Hi i have seen that in this book there is no code to play continue the sudoku game. so please check and update that.
Also when someone click on about then also the text of about is not appearing.

Thanks

Categories: