2. Accelerometer

An accelerometer is a device that measures the physical acceleration of an object. On mobile devices, the accelerometer, where implemented, is used to allow the device or an application running on the device determine its orientation in a three dimensional space (using X, Y and Z coordinates). The Cordova Accelerometer API allows a Cordova application to read the values measured by the accelerometer.

The Cordova API documentation indicates that the values returned by the Accelerometer indicate the changes in a device’s motion through space, but that’s really not the case. If the accelerometer were actually measuring motion through space, then the accelerometer API would return no information when the device is stationary—that ...

Get Apache Cordova API Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.