Errata

Programming Android

Errata for Programming Android

Submit your own errata for this product.

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
Printed Page 257
1st Note

The note says "We've used ls as an example of a command...". However, the example does not use ls, but instead uses "select * from video".

Jamie Cox  Jan 19, 2012 
Printed Page 267
Loading and Starting application

I tried to run the application as downloaded and the google server returned multiple error 3 and then the emulator crashes.

I then went though the procedure to signing an application, got a map api key, updated the key in the layout file .....

Still the same problem.

I've tried this on various versions of the emulator and always the same issue.

Is the code still working after the latest updates to the api, sdks ... ?

Steve Webb  Nov 10, 2011 
Printed Page 305

I've been reading the section on Content Providers and think I have got my head around them fairly well. However I'm a little unsure how they fit in regarding installation onto a google device in relationship to previous providers. I'll explain:

Lets say I have an idea for several applications, lets say they are sports score related. Ideally I would want a content provider which they could all use to record and query scores but display the data differently, some showing data that others do not.

Now my puzzle is I don't know which application a user would buy first, or second and so on. So how would I make sure that a content provider is created, registered and possibly upgraded when a more up to date application is bought. Obviously I also do not want the content provider to be downgraded when an older related application is bought.

I'm not sure if any of this is in fact possible? If it is not I can see the benefit of providers for data such as contacts which are central to the android eco system but not for normal bought application where several related application might want to create, update, query and delete related data.

If it's not possible what is the best strategy to allow cross application data CRUD. I assume each app can only update its own database in its own sandbox without providers. Or is there a way of creating a database outside the sandbox?

Steve Webb  Nov 15, 2011 
PDF Page 338

In Step 4: Implementing the RESTful Request, "extend" used in the following line should be replaced with "extends":

FinchVideoContentProvider extend RESTfulContentProvider {

Note from the Author or Editor:
Note sent to submitter

Emerson Wang  Jan 06, 2012 
Printed Page 347
Code for YouTubeHandler

Chapter 12 (pp 331 and 332) introduce the "Network MVC" design pattern, in which clients obtain rapidly cursors to cached data and then get updated, fresh, data directly from the network:

On page 332, last paragraph:

"The provider client requests data and receives a cursor quickly; the cursor is notified when network data arrives."

Yet, looking at the code for YouTubeHandler, I cannot find an explicit notification being sent. I was expecting a call such as the following to appear somewhere in YouTubeHandler:

mContext.getContentResolver().notifyChange(uri, null);

(where "mContext" is a reference to the context and "uri" is the parameter passed to FinchVideoContentProvider.query).

Is this being done automatically by the system? The ListView control in the FinchVideoActivity is being refreshed correctly.

Bernard Gagnon  Dec 18, 2011