O'Reilly logo

PhoneGap 4 Mobile Application Development Cookbook by Zainul Setyo Pamungkas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

Introduction

Mobile devices are incredibly powerful tools that not only allow us to make calls and send messages, but also help us navigate and identify where we are in the world, thanks to the accelerometer, geolocation, and other sensors.

This chapter will ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required