O'Reilly logo

PhoneGap Essentials: Building Cross-Platform Mobile Apps by John M. Wargo

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

10. Accelerometer

The Accelerometer API allows a PhoneGap application to determine a device’s orientation in a three-dimensional space (using X, Y, and Z coordinates). The current PhoneGap API documentation claims that the values returned by the accelerometer indicate the changes in a device’s motion through space, but in testing what the accelerometer returns are values that define the device’s actual orientation in a three-dimensional space. If the accelerometer were actually measuring motion through space, then the accelerometer API would return no information when the device is stationary, which is not the case.

For example, on an Android device, with the device lying flat on a tabletop, the accelerometer will return approximately the following ...

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