There are many ways to learn to program for the Android platform that powers many smartphones, tablets and other devices. Google offers fairly extensive and free tutorials and documentation. So why would you want to buy and read a book? Read on for my Android in Action review.
One of my long-term goals has been to
get into mobile development. I’ve always liked the idea of reusing my existing Java knowledge and really learn Android. I used the second edition of Android in Action to give me a quick start.
Android 2
First things first, you may be wondering why bother with a book that only covers Android 2. Android is already up to version 4 now.
If you take a look at the platform distribution dashboard you’ll know why: 2.3.3 has, by far, the largest install base. And I doubt this is going to change soon. Much of the features of the later Android version are simply beyond the possibilities of mobile hardware and are aimed at higher level hardware (like tablets and set top boxes)
Android in Action
<figcaption class="wp-caption-text">After 4 chapters of Android in Action, you’ll be ready for real Android action.</figcaption></figure>
The book consists of a few introductory chapters that focus on a detailed explanation of the Android fundamentals (like intents, activities and services). Afterwards most of the chapters focus on the different parts of the API: notifications, telephony, graphics, etc.
Given that the core of Android is pretty different than the usual Spring/JEE fair, I think the authors made the very wise decision of focusing on it a lot. After you’ve gone over the first 4 chapters, you will have a good understanding of the basics.
Experienced developers will probably only need those first 4 or 5 (on data storage) chapters. Incidentally, if you’ve grown used to the JavaScript and Node.JS event-based and non-blocking way of working, you’ll have a leg up on the other developers.
Part 3, containing chapters 12 and 13 is a little different. These chapters contain an in-depth look at two applications. There’s still some new knowledge in those chapters (especially 13), but these are mainly aimed at applying what was learned in the previous chapters. I found chapter 12 very useful, but I’m not sure if chapter 13 will be useful for many people. But it’s good to know it’s there if I ever need to create low-level apps.
There’s also a full chapter on web development (16) which, although a bit brief, is very timely.
The overall quality of writing is excellent. You will need some experience with Java to get the most out of the book. If you don’t know Java yet, you’ll probably get stuck too much on the example code.
Sample code
<figcaption class="wp-caption-text">The examples in Android in Action give your a taste of most of the Android API</figcaption></figure>
The usage of example code is well chosen and the code does interesting things. The book does not print the entire code, so be sure to download the full example code package before you start.
Many examples integrate various web services and result in pretty impressive apps with little actual development. The disadvantage is that many of the used services are no longer available or have changed their API. There are some limited fixes provided in the book forum, but overall, you’ll be on your own.
But lets talk about chapter 12. I’m not sure what happened there, but it feels like an ActionScript developer was let loose on the Java world. I don’t think I’ve ever seen the use of underscores to indicate private fields in a Java program, but chapter 12 has them. To top that of, there are lower case class names, uppercase method names and underscore-separated names.
I’m not sure what happened there, but although the example was very good, the code style was extremely distracting.
The good
- It covers pretty much everything in the Android 2 SDK, including some stuff that you’re probably never going to need.
- Examples are well chosen and explanation is thorough.
The bad
- Actual code quality of the examples is a mixed bag.
- No in-depth overview of APIs limits the use of the book as a reference.