|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.system.AccelerometerData
public class AccelerometerData
Encapsulates accelerometer sensor readings. Contains some or all of the following acceleration information:
AccelerometerSensor.ORIENTATION_TOP_UP
or AccelerometerSensor.ORIENTATION_LEFT_UP
.
AccelerometerData.getXAccHistory()
, AccelerometerData.getYAccHistory()
and
AccelerometerData.getZAccHistory()
have the most recent acceleration value stored at
index 0, while the oldest value is stored at the end of the array. AccelerometerSensor
.
The data object is populated based on the channel configuration (see AccelerometerChannelConfig
).
For example, if an application is only interested in orientation information, raw acceleration sample values are not provided.
AccelerometerChannelConfig
Method Summary | ||
---|---|---|
long |
getLastTimestamp()
Returns the timestamp for the last raw acceleration measurement. |
|
short |
getLastXAcceleration()
Returns the latest acceleration along X axis. |
|
short |
getLastYAcceleration()
Returns the latest acceleration along Y axis. |
|
short |
getLastZAcceleration()
Returns the latest acceleration along Z axis. |
|
int |
getNewBatchLength()
Returns count of the new samples in the historical array since the last query call. |
|
int |
getOrientation()
Returns the last known orientation of the handheld. |
|
long[] |
getSampleTsHistory()
Returns sample timings. |
|
short[] |
getXAccHistory()
Returns historical readings for acceleration along the X axis. |
|
short[] |
getYAccHistory()
Returns historical readings for acceleration along the Y axis. |
|
short[] |
getZAccHistory()
Returns historical readings for acceleration along the Z axis. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public short getLastXAcceleration() throws NullPointerException
NullPointerException
- if the data is retrieved from orientation only channel, resulting in
no raw sample buffers being allocated.public short getLastYAcceleration() throws NullPointerException
NullPointerException
- if the data is retrieved from orientation only channel, resulting in
no raw sample buffers being allocated.public short getLastZAcceleration() throws NullPointerException
NullPointerException
- if the data is retrieved from orientation only channel resulting in
no raw sample buffers being allocated.public long getLastTimestamp() throws NullPointerException
NullPointerException
- if the data is retrieved from orientation only channel, resulting in
no raw sample buffers being allocated.public int getOrientation()
AccelerometerSensor
class if queried; -1 otherwiseAccelerometerSensor
public short[] getXAccHistory()
null
otherwise.public short[] getYAccHistory()
null
otherwise.public short[] getZAccHistory()
null
otherwise.public long[] getSampleTsHistory()
null
otherwise.public int getNewBatchLength()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal