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 (www.mattgifford.co.uk).”
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.
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
Command lie to create Cordova project 242
Compass (show direction) 40
Database (SQLite) 61
Dreamweaver CS6/GitHub.com/PhoneGap Build 274
Eclipse install and use 258
Google Maps 33
Jquery Mobile & ThemeRoller 193
Local File (create, save, retrieve) 52
Local Storage 70
Network connection status 149
PhoneGap Build, Hydration 287
Remote server (upload file) 66
Search (Google search) 145
Xcode template with PG 1.9.0 247