Class Accelerometer
Defined in: phonegap.js.
Constructor Attributes | Constructor Name and Description |
---|---|
This class provides access to device accelerometer data.
|
Field Attributes | Field Name and Description |
---|---|
The last known acceleration.
|
Method Attributes | Method Name and Description |
---|---|
clearWatch(watchId)
Clears the specified accelerometer watch.
|
|
getCurrentAcceleration(successCallback, errorCallback, options)
Asynchronously aquires the current acceleration.
|
|
watchAcceleration(successCallback, errorCallback, options)
Asynchronously aquires the acceleration repeatedly at a given interval.
|
Field Detail
lastAcceleration
The last known acceleration.
Method Detail
clearWatch(watchId)
Clears the specified accelerometer watch.
- Parameters:
- {String} watchId
- The ID of the watch returned from #watchAcceleration.
getCurrentAcceleration(successCallback, errorCallback, options)
Asynchronously aquires the current acceleration.
- Parameters:
- {Function} successCallback
- The function to call when the acceleration data is available
- {Function} errorCallback
- The function to call when there is an error getting the acceleration data.
- {AccelerationOptions} options
- The options for getting the accelerometer data such as timeout.
watchAcceleration(successCallback, errorCallback, options)
Asynchronously aquires the acceleration repeatedly at a given interval.
- Parameters:
- {Function} successCallback
- The function to call each time the acceleration data is available
- {Function} errorCallback
- The function to call when there is an error getting the acceleration data.
- {AccelerationOptions} options
- The options for getting the accelerometer data such as timeout.