Thursday, 3 March 2011

The busy coder's guide to Android development 1.1 - bugs or incompatibility

The version 1.1 of this book has been released more than 2 and half years ago. Now they are going for the version 3.5 (released on 26 of Feb of 2011).

Although most of the samples of the books has been rewritten, I think there could be someone else who is also using the book for some reason. Mainly because the samples are still working for Android 2.1.

Incompativility 1
Page 169 -PrefsDemo sample.
At the final of the code, when it is setting the listener for the button, it create a new Button.OnClickListener. It should be View.OnClickListener. The same thing happens in the page 178.

Incompativility 2
In the "try-catch" sentences, the author use a method called "showAlert" which doesn't work. Since it is part of catch, if you comment it, the code will still working.

Incompativility 3
Page 246. For the intents, the name has been changed. VIEW_ACTION is now ACTION_VIEW. Also in Page 251, PICK_ACTION should be ACTION_PICK.

Incompativility 4
Page 251. The method startSubActivity has been renamed by "startActivityForResult".

Incompativility 5
Page 254. For use the ListAdapter, the package android.widget.ListAdapter should be imported. I also have problem when I am creating the class ActivityAdapter(this, i). It seems it has been changed.
TODO: Solve ActivityAdapter (this, i)

*I will updating this post with new incompatibility if I found them

No comments:

Post a Comment