Book Image

PhoneGap 3.x Mobile Application Development HOTSHOT

By : Kerri Shotts
Book Image

PhoneGap 3.x Mobile Application Development HOTSHOT

By: Kerri Shotts

Overview of this book

<p>PhoneGap allows you to use your existing knowledge of HTML, CSS, and JavaScript to create useful and exciting mobile applications.<br /><br />This book will present you with 12 exciting projects that will introduce you to the dynamic world of app development in PhoneGap. Starting with their design and following through to their completion, you will develop real-world mobile applications. Each app uses a combination of core PhoneGap technologies, plugins, and various frameworks covering the necessary concepts you can use to create many more great apps for mobile devices.</p>
Table of Contents (21 chapters)
PhoneGap 3.x Mobile Application Development HOTSHOT
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Designing our data models


Although this is a new app, there's quite a bit of similarity between this app and the Filer app. Instead of noteStorage and textNoteEditView, we'll be using pathStorage and pathEditView. Of course, there are some changes in the data models to be aware of, including new models to handle position data.

Getting on with it

The biggest difference between this new app and Filer is the type of data it processes. A note only had a few properties, but a path can have dozens (even hundreds) of places within it. It should be apparent that we're dealing with two separate objects: Place and Path. Of course, as it was necessary in the Filer app, we'll also need a storage mechanism for these objects. Consider the following diagram:

Much of this should look pretty familiar by now. You can see that the Place model directly mirrors most of the position data obtained from the geolocation API. Only the extra properties have to do with formatting the latitude and longitude in a human...