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.

xyz.jpg

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 1.0+
- BlackBerry 10
- Ripple Emulator
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
x       Y Y YY
y       Y Y YY
z       Y Y 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 and BlackBerry 10+)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Properties

Number x
Number y
Number z

Properties

readonly Number x


x-coordinate of the acceleration


Supported Platforms
 - BlackBerry PlayBook 1.0+
 - BlackBerry 10
 - Ripple Emulator

readonly Number y


y-coordinate of the acceleration


Supported Platforms
 - BlackBerry PlayBook 1.0+
 - BlackBerry 10
 - Ripple Emulator

readonly Number z


z-coordinate of the acceleration


Supported Platforms
 - BlackBerry PlayBook 1.0+
 - BlackBerry 10
 - Ripple Emulator

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