Working with the accelerometer of a BlackBerry device
On a BlackBerry® device with an accelerometer, you can create a BlackBerry device application that listens for accelerometer events and retrieves data about the orientation of the BlackBerry device.
The BlackBerry OS converts accelerometer readings into orientation coordinates such as TOP_UP, FACE_UP, and LEFT_UP. The BlackBerry OS may also rotate the screen in response to accelerometer readings.
Querying the accelerometer consumes battery power. Connections to the accelerometer should not be kept open for long periods of time.
- Types of accelerometer data
- Accelerometer
- Retrieve accelerometer data at specific intervals
- Query the accelerometer when the application is in the foreground
- Query the accelerometer when the application is in the background
- Store accelerometer readings in a buffer
- Retrieve accelerometer readings from a buffer
- Get the time a reading was taken from the accelerometer
Parent topic: Creating user interfaces