Book Image

PhoneGap 2.x Mobile Application Development HOTSHOT

By : Kerri Shotts
Book Image

PhoneGap 2.x Mobile Application Development HOTSHOT

By: Kerri Shotts

Overview of this book

<p>Do you want to create mobile apps that run on multiple mobile platforms? With PhoneGap (Apache Cordova), you can put your existing development skills and HTML, CSS, and JavaScript knowledge to great use by creating mobile apps for cross-platform devices.</p> <p>"PhoneGap 2.x Mobile Application Development Hotshot" covers the concepts necessary to let you create great apps for mobile devices. The book includes ten apps varying in difficulty that cover the gamut – productivity apps, games, and more - that are designed to help you learn how to use PhoneGap to create a great experience.</p> <p>"PhoneGap 2.x Mobile Application Development Hotshot" covers the creation of ten apps, from their design to their completion, using the PhoneGap APIs. The book begins with the importance of localization and how HTML, CSS, and JavaScript interact to create the mobile app experience. The book then proceeds through mobile apps of various genres, including productivity apps, entertainment apps, and games. Each app covers specific items provided by PhoneGap that help make the mobile app experience better. This book covers the camera, geolocation, audio and video, and much more in order to help you create feature-rich mobile apps.</p>
Table of Contents (19 chapters)
PhoneGap 2.x Mobile Application Development HOTSHOT
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
InstallingShareKit 2.0
Index

Designing the data model


Go ahead and get your paper and pencil out again. We need to design the data model for the app. We'll have two portions: one to manage the list of available documents, and another to manage a single document.

Getting on with it

Here's what our model looks like:

The first model, named FilerDocuments, is responsible for managing all the files available to the app, while the one on the right, named FilerDocument, is responsible only for a single note. The latter is responsible for loading a note and saving a note, while the former is responsible for reading an entire directory of notes and then managing them via renames, copies, and deletes.

A few notes of interest before we wrap this task up. Notice all methods that end with …Success. This is simply due to the way the File API is structured; everything is done asynchronously so you have to write each call to it with callbacks to both a success and a failure function. The success function points at the corresponding Success...