Thursday, September 8, 2011

Book Review "Android 3.0 Application Development Cookbook"

Book Review for "Android 3.0 Application Development Cookbook"

The Android Novice's guide to doing just about anything.

Android 3.0 Application Development Cookbook

This book is presented in Packt's "CookBook" format, which means it is a series of how-to steps that show the reader how to accomplish some task. In this case, the book shows how to program Android devices using the Eclipse ADT plug-in.

Establishing the development environment was a bit troublesome in my case. I've done a little Android development in the past, but the machine I used was underpowered for the emulator, so I decided to set up Eclipse and my Android environment on my Fedora 13 quad-core. The book is of little value here-- pretty much you are told what you need, and are left on your own to get it set up. Luckily, I'm familiar with this sort of task, so things were running smoothly after the initial install and about a half an hour of Google'd help from other ADT users.

In the early chapters, the book is very explicit about how to set up your Eclipse project and which files to edit. The author takes no chances that the reader is unfamiliar with the environment, and spells everything out in perfect detail. Normally, I prefer printed books to electronic, but this is one case where an e-book would've been handy-- for code copying purposes. I spent my learning time dutifully typing in the author's suggestions, though, and was rewarded with properly running examples each time.

The first chapter is about 'Activities', which results in a window being presented on the device. (In my case, the emulator.) You are shown how to make an Activity, how to store state, how to send an 'Intent' (which is like a message that can be sent to another Activity or other receiver). This chapter spells out the steps in complete detail, so the reader should be assured of success if he has his development environment set up correctly. Later chapters omit some of the detail, but you are never given so little that you can't accomplish what you want. It's just the first chapter that sets the basics for the reader.

All the chapters are set up the same way. There is little or no 'academic background', each chapter is a series of step-by-step descriptions of how to accomplish some goal. I think this book will be a very effective reference for development, I imagine many copies will be kept close at hand.

There is surprising depth in the list of tasks this book teaches. Here's an incomplete list, to show you some of the things that are presented:

- Drawing your UI
- Making menus, context sensitive menus, shortcut keys and submenus
- Storing data on internal storage, external storage, the included SQLite database
- Detecting device orientation, using the accelerometer, detecting user gestures and the available sensors
- Communicating with the user through Alerts, progress bars, status bars and dialogues
- Adding graphics, rotating images, and using animation
- Playing audio files and recording video, audio and taking pictures
- Sending and receiving phone calls and SMS messages, using internet content
- Detecting the device location, using Google maps and other mapping skills

Sounds like a pretty cool list, huh? Each of these tasks is shown in a manner that isolates it from other problems, so you are basically shown the way to write a tiny application that showcases just the feature you are interested in.

Readers looking for lots of explanatory text about the big picture are going to be disappointed-- this book is all about getting the task done. In that regard, it is quite effective.

All things considered, I liked this book and would recommend it to anyone who is doing Android development. Beginners will get a decent introduction to some small projects (they'd better be ready to augment their knowledge with the online APIs and other sources, though.) More experienced developers will probably know some of the material, but can surely learn from the wide variety of capabilities explored. Basic skills necessary are fundamental Java, a little knowledge of XML, and a willingness to follow instructions and look for details elsewhere. If you've got those, you can develop for Android with this book.

The book can be found here.

Happy Droid Development!

Tuesday, September 6, 2011

MEAP Review: Spring Integration in Action

A hands-on guide for using Spring's Integration framework.

Disclaimer: I work for JBoss and support JBoss ESB, which can be viewed as a competitor to Spring Integration. This review will cover only the book "Spring Integration in Action" and only the features of Spring Integration it describes.

Spring Integration is a toolkit that fits the needs of Enterprise users who need to facilitate communication between disparate applications. If you're not familiar with the workspace, these toolkits allow the user to perform tasks like the following: read text files in and invoke backend web services for each record in the file; proxy a web service and allow you to alter either the data going to the targeted backend service or alter the response received from it; log http requests to a database; many others.

The book is well-written and describes Spring Integration usage often in terms of the famous 'Enterprise Integration Patterns'. The Patterns are well-known and time-tested methods of successfully achieving tasks, and the book's author does a good job of demonstrating how Spring Integration can be used to implement them.

"Spring Integration in Action" is broken up into 4 areas:
- Background
- Messaging
- Integrating Systems
- Advanced Topics

The 'Background' section has 2 chapters. There's a short introductory section that covers Spring, for those unfamiliar with this famous Dependency Injection framework. I expect most users will breeze by this, but it probably will be necessary for others. The second chapter deals with the "Enterprise Integration Patterns", which are time tested best practices in the Integration workspace. The book does justice to the topic in this chapter, but really spreads a lot of the 'Pattern' information around the rest of the book as well.

'Messaging', as the section title suggests, deals with the fundamental parts and pieces that help Spring Integration shuffle data from component to component. Integration toolkits require ways to pass messages along (Integration is mostly about messaging), in Spring Integration these are called "Channels". Channels are very important in Spring Integration, as they determine the runtime characteristics (i.e. number of threads) that will be part of your pipeline. This can be a topic of confusion, so it's good the author discusses it early.

Components deal with messages, messages travel along channels. In between these two is an 'Endpoint', another important topic. Endpoints can be outward-facing (gateways), and can be event-driven or polling in nature. Endpoints are covered in the same plain-spoken manner as the rest of the basic components.

The next few chapters deal with more 'generic' Integration best practices. These include the way messages are transformed (so different systems can 'talk'), the way messages can have information added to them, and how you can route and filter the messages that travel between components. If you've been in the workspace, this all probably sounds familiar. If you haven't-- the book provides a good explanation of how things work.

'Integrating Systems' deals with the construction of your message pipeline and some of the components you'll likely need. You'll be wanting to split and recombine messages, convert Java objects to XML (and vice-versa), and how to hook JMS into your pipeline. You'll also want to deal with the file system, web services and maybe email-- these are all explained here.

'Advanced Topics' is a potpourri of topics that you may or may not find a need for. It seems most every book today has to cover publishing to social media outlets, this one does as well. Batch application integration (using Spring Batch, naturally) is explained. There are also some chapters I found of very high value: managing and monitoring, scheduling and concurrency, and Test Driven Development best practices.

This book is in Manning's "MEAP" program, which means it is available for early purchase, but is still being worked on. In this reader's opinion, the current MEAP version is of sufficient value to warrant a purchase. There's a lot of good material here, it's probably very close to a completed state.

So, what's the final verdict? I like the book for the clear explanations of how Spring Integration works. For users of other integration toolkits, there's also a lot of generic 'Systems Integration' knowledge that would be of value. If you're a Spring Integration user, buying this book should be a no-brainer-- it will quickly pay for itself many times over. If you're not a Spring Integration user, but are a user of another system integration toolkit-- you still might consider it, for the overall Integration value. All things considered, this book will be a good reference for the Integration user.

The book can be found here.