HTML5 Acceleration

Acceleration data is given in meters per second squared and uses the body axes defined in the device orientation event. Acceleration data (without the effect of gravity) cannot be provided when there is a lack of a gyroscope. Implementations that are unable to provide acceleration data without the effect of gravity may instead supply the acceleration including the effect of gravity.

The values reported are equal to the acceleration of the device, plus an acceleration equal and opposite to the acceleration due to gravity. This is less useful in many applications but is provided as a means of providing best-effort support. These values can be stored and manipulated in variables outside the event scope. These values can be used to control the motion of objects defined on the DOM by the device's gyroscope and accelerometer.



Data Examples= A device lying flat on a horizontal surface with the screen upmost has an acceleration of zero and the following value for accelerationIncludingGravity=

{x= 0, y= 0, z= 9.81};

Supported Platform(s)

- BlackBerry PlayBook
- Ripple Emulator

View Supported Platform Table

APIOS 5.0OS 6.0OS 7.0PlayBookRipple
x       YY
y       YY
z       YY

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:

This API does not require a <feature> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Permission Elements (PlayBook Only)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.

API Summary


Properties

Properties:


Property Type Description Supported Platform(s)
x Number
readonly
x-coordinate of the acceleration
 - BlackBerry PlayBook
 - Ripple Emulator
y Number
readonly
y-coordinate of the acceleration
 - BlackBerry PlayBook
 - Ripple Emulator
z Number
readonly
z-coordinate of the acceleration
 - BlackBerry PlayBook
 - Ripple Emulator

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 13:31:15 GMT-0500 (EST)