This library provides access to the accelerometer of the
device. The accelerometer is a motion sensor that detects the change
(delta) in movement relative to the current device orientation in
the x, y, and z dimensions.
Record
Acceleration indicates the accelerometer data.
- X, the change in the x dimension.
- Y, the change in the y dimension.
- Z, the change in the z dimension.
- a_timestamp, The timestamp of the acceleration.
Frequency, the interval to get accelerometer in millisecond.
- Functions
- getCurrentAcceleration (onSuccess AccelerometerSuccess in, onError
CordovaErrorHandler in)
- Gets the current acceleration and returns to the onSuccess callback
function.
- onSuccess
- The success callback of AccelerometerSuccess,
with the acceleration.
delegate AccelerometerSuccess (acceleration Acceleration in) end
- onError
- The error callback function.
- watchAcceleration(onSuccess AccelerometerSuccess in, onError CordovaErrorHandler
in, options AccelerometerOption in) returns(String)
- Retrieves the current Acceleration of the device at a regular
interval and executes the onSuccess callback function each time.
- onSuccess
- The success callback.
- onError
- The error callback function.
- options
- An instance of AccelerometerOption to identify the watch interval.