Author: Andrew Lunny
Publisher: Packt Publishing
Aimed at: HTML web developers
Pros: PhoneGap is topical and popular
Cons: Lacks a logical structure, doesn't go far enough
Reviewed by: Harry Fairhead
A second general problem is that not all of the phones treat HTML and CSS in the same way. This means that a book to guide you through the difficulties and compatibilities should be useful and this particular one is written by a PhoneGap insider - so it should be good.
The book starts off by considering how to install PhoneGap. Unfortunately it only covers iOS and Android with a quick look at BlackBerry. A good book on PhoneGap would cover all of the platforms supported in equal depth - after all this is the point of PhoneGap. Chapter 1 is also where you first encounter the "What just happened?" section. This retrospectively explains what you have just had presented. It might seem like a good ploy and it's not bad as a novelty but a good book should tell you enough before showing you something so that explaining post hoc isn't necessary. Some clarification perhaps but not "What just happened?".
The next chapter is titled Mobile Web to Mobile Applications, which again is a good idea. It explains how to replace the services usually provided by the web server, but in practice this comes down to local storage. The chapter also covers view templating with Mustache - not a bad choice but what has it got to do with replacing server-provided facilities, and what if you want to use something else?
Chapter 4 is on managing a cross platform code base - which is really about creating a single code base using feature sniffing or platform detection. This isn't rocket science but it is nice to have it explained in detail.
Chapter 5 moves on to using libraries and the choice is XUL - again a reasonable choice but there are others. Next we look at the problems of CSS - which with its vendor prefixes is currently one of the biggest headaches any HTML app creator has. Unfortunately the chapter doesn't have much general to say, just a lot of particular examples.
Finally Chapter 7 gets on to working with device sensors via PhoneGap calls - this should be the core of the book but to be honest it is too easy. This is not where the difficult part of using PhoneGap is. The same goes for Chapter 8 and using the camera and data files and Chapter 9 on reading and writing to contacts. These are all welcome chapters, and they have to be in any book on PhoneGap, but they don't really go beyond what you would learn from reading the documentation.
Chapter 10: How to create PhoneGap Plugins does provide something advanced. This isn't something that everyone will need to do but it is nice to know that it is possible to extend PhoneGap and how to do it. After all you might discover that you need something more than the basic provision and you might even want to make your plugin commercial. The final chapter is on working offline - sync and caching.
Overall the book doesn't quite make the grade. You feel that it is trying really hard to be friendly and to break out of the straitjacket of a standard technical book with clever sections and quizzes (with answers at the back), but it would be better to work out a good logical way of explaining how best to work with PhoneGap. The author's style is humorous, but only if you share his sense of slightly sarcastic humour. I'm sure it is all intended as a big friendly hug, but I'd rather have some cold hard logic and clarity. There are also quite a few mangled sentences - none so bad that I couldn't work out what the author was saying, but it makes you feel that the book has just been rushed out without due care and attention.
There is a good book to be written about working with PhoneGap and creating single code base, cross platform HTML apps but this isn't it. Its of some use for the beginner but not for the intermediate or expert HTML app creator.
Getting started with PhoneGap