Book Image

PhoneGap 4 Mobile Application Development Cookbook

Book Image

PhoneGap 4 Mobile Application Development Cookbook

Overview of this book

Table of Contents (19 chapters)
PhoneGap 4 Mobile Application Development Cookbook
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Chapter 2. Movement and Location – Using the Accelerometer and Geolocation Sensors

In this chapter, we will cover the following recipes:

  • Detecting device movement using the accelerometer

  • Adjusting the accelerometer sensor update interval

  • Updating a display object position through accelerometer events

  • Obtaining device geolocation sensor information

  • Adjusting the geolocation sensor update interval

  • Retrieving map data through geolocation coordinates

  • Creating a visual compass to show the device direction