PhoneGap Beginner's Guide
Author: Andrew Lunny
Publisher: Packt Publishing
Pages: 328
ISBN: 978-1849515368
Aimed at: HTML web developers
Rating: 3.5
Pros: PhoneGap is topical and popular
Cons: Lacks a logical structure, doesn't go far enough
Reviewed by: Harry Fairhead

This book is written by a member of the PhoneGap team at Nitobi. Sounds promising.

Author: Andrew Lunny
Publisher: Packt Publishing
Pages: 328
ISBN: 978-1849515368
Aimed at: HTML web developers
Rating: 3.5
Pros: PhoneGap is topical and popular
Cons: Lacks a logical structure, doesn't go far enough
Reviewed by: Harry Fairhead

 

PhoneGap is becoming an increasingly popular way of building mobile phone apps that look like native apps but are in fact augmented HTML apps. You create the user interface using HTML/CSS and write the code in JavaScript. You gain access to the internals of the phone via JavaScript libraries that are part of PhoneGap.

This makes it sound as if this is so simple you couldn't possibly need a book to help you do it, but there are some problems. The first is that to create a PhoneGap app for a particular phone you have to have the relevant SDK installed and you have to incorporate the HTML/JavaScript into the project. You don't need to know much about developing for the particular platform but it can be difficult. You can partly avoid this problem by using PhoneGap's web based service which takes the HTML/JavaScript files and spits out an app for any phone they support. This is easy and free to try out. However, if you want full control over what is going on then you need to do it yourself.

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.


Banner

 

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?".

Chapter 2 moves on to building and debugging on multiple platforms, which sounds promising, but it is just about building apps in a browser before you get to moving them onto the phone platform. It covers using a debugger and eventually does get to inserting some native calls. If you have done any HTML/CSS and JavaScript development then most of this will be known to you. There are some useful hints, but as you read on you discover that they presented more than once. You also meet the "Have a go hero" section, which basically encourages you to explore some facility or other by discovering the answers to questions. Personally I would prefer to be told enough about how things work to be able to have a good guess at what was going to happen before I started coding.

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 are lots of useful hints and tips for the beginner, but if you know how to create an HTML/CSS/JavaScript app and just want to know how to work with PhoneGap you will find a lot of the book irrelevant.

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.

See also:

Getting started with PhoneGap


Banner


Coding for Beginners, 2nd Ed (In Easy Steps)

Author: Mike McGrath
Publisher: In Easy Steps
Pages: 192
ISBN:978-1840789751
Print:1840789751
Kindle: B0B56LN77V
Audience: Complete beginners to programming
Rating: 4
Reviewer: Sue Gee

This book aims to introduce hands-on modern programming to complete beginners. Can this be achieved in fewer than 180 [ ... ]



Learn dbatools in a Month of Lunches

Author: Chrissy LeMaire et al
Publisher: Manning
Pages: 400
ISBN: 978-1617296703
Print: 1617296708
Kindle: B0B39PCHL8
Audience: SQL Server DBAs
Rating: 5
Reviewer: Ian Stirk 

This book aims to make it easier to manage your SQL Server estate, how does it fare? 


More Reviews

Last Updated ( Friday, 02 December 2011 )