Book review: PhoneGap Mobile Application Development Cookbook, by Matt Gifford

October 2012. Published by Packt Publishing Ltd. ISBN 978-1-84951-858-1.
Packt asked me to review the book, which I did in PDF format.

About the author: “A regular presenter at national and international conferences, Matt Gifford also contributes articles and tutorials in leading international industry magazines, as well as publishing on his blog (”

This book functions as a cookbook, so it creates spare apps that do exactly what they set out to do and little else. As a result, there is no disc of complicated code included. The benefit of this approach is that you don’t get lost in the programming of a more fully functioning app. The cookbook format, however, means that you will get only little more explanation of the code than what you’ll see on PhoneGap’s site. So this is not a book for those already comfortable using the code on PG’s site.

He covers a lot of information in his 320-page book, mainly for Cordova 2.0.0.

Accelerometer: captures and displays the angle at which your device is being held. You program a circle that moves over the screen based on the tilt angle of your device.

Geolocation: captures and displays the location of the device’s latitude and longitude and other information. Implement Google Maps API (Application Programming Interface) to show the device’s location on a map. You program a compass showing the position of N, S, E, W.

FileSystem: Locate and download a file from the web to the device so the user has later access to it. Also create a file, save to system, and retrieve it later. Read the contents of a directory from the device’s root filesystem and display them in a list format.

Camera: Shoot a picture, then upload the file to a remote server.

Database: create a local SQLite database. Covers Local Storage (uses Jquery and Jquery Mobile as its layout, and uses its Ajax and JSON code).

Audio: Record and save audio with the device’s audio recording application, and within your app. Play audio files from the local file system or over the network.

Video: Capture video with the device’s application.

Pictures: Take photos and pull picture from device’s Camera Roll or Library. Edit the color of the picture.

Contacts: List contacts, display an individual’s contact information with LocalStorage, create and save a new contact. Uses Jquery for the interface.

In addition, we learn how to use the XUI Javascript library, “which was written and maintained by core members of the PhoneGap development team specifically for use in mobile applications, and removes much of the unrequired tools and hidden engines that do not apply to the modern browsers available in mobile devices.”

We learn to use XUI’s find method to locate specific elements in the document, DOM manipulation, touch and gesture events, updating element styles (resizing and changing color) in response to calls, working with remote data, and animation of elements.

A small section is devoted to creating a mobile layout with Jquery Mobile, including using its ThemeRoller.

A chapter is devoted to extending PhoneGap plugins for Android (in Eclipse) and the iPhone (in Xcode), by making a plugin that displays “Hello World” in an alert.

A chapter is devoted to development tools, and is quite diverse, covering development of Cordova apps with the command line, Xcode template (for PhoneGap 1.9.0 only), Eclipse, and Adobe Dreamweaver CS6, in concert with the PhoneGap Build service.

The book ends with a thorough, 7-page index so you can go right to the place you’re looking for.

Below, I’ve put a table of contents of sorts based on the features used in the book so I can look them up from this page:

Accelerometer (detect device angle) 7
Android Virtual Device 270
Application pause 131
Application resume 134
Audio (Media) 79
Battery levels, display 138
Camera 66
Command lie to create Cordova project 242
Compass (show direction) 40
Contacts 130
Database (SQLite) 61
Dreamweaver CS6/ Build 274
Eclipse install and use 258
FileSystem 47
Geolcation 23
Google Maps 33
Jquery Mobile & ThemeRoller 193
Local File (create, save, retrieve) 52
Local Storage 70
Network connection status 149
PhoneGap Build, Hydration 287
Pictures 120
Remote server (upload file) 66
Search (Google search) 145
Video 96
Xcode template with PG 1.9.0 247
XUI Javascript library 161

One thought on “Book review: PhoneGap Mobile Application Development Cookbook, by Matt Gifford

  1. PhoneGap it’s a great tool to build Android apps, and this book it’s a quite good reference to it. The book covers 9 main areas (from accelerometer and geolocation to contacts, jQuery Mobile and plugins). In total there are more the 40 recipes.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s