|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.system.AccelerometerSensor.Channel
Encapsulates an active connection to accelerometer sensor. While the channel
remains open the sensor is queried for samples. Invoke the close()
method to close the channel and stop querying the sensor in order to preserve battery power.
| Method Summary | ||
void |
close()
Closes the channel and stops querying the sensor. |
|
AccelerometerData |
getAccelerometerData()
Returns the last acceleration data along with optional historical samples. |
|
void |
getLastAccelerationData(short[] xyz)
Returns last accelerometer raw reading |
|
int |
getOrientation()
Returns current orientation. |
|
boolean |
isActive()
Returns if the channel is currently active and collecting requested data. |
|
boolean |
isOpen()
Determines if the channel is open or is closed |
|
void |
removeAccelerometerListener()
Deregisters previously assigned listener. |
|
void |
setAccelerometerListener(AccelerometerListener l)
Registers an accelerometer listener. |
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public void close()
public AccelerometerData getAccelerometerData() throws IllegalStateException
IllegalStateException - if called on a closed channel
public void getLastAccelerationData(short[] xyz)
throws IllegalArgumentException,
IllegalStateException
xyz - an allocated array of three elements to store x, y and
z axis acceleration information.IllegalArgumentException - if passed argument is NULL, or its length is not equal
to 3.IllegalStateException - if called on a closed channel.
public int getOrientation()
throws IllegalStateException
AccelerometerSensor.ORIENTATION_BACK_UPIllegalStateException - if called on a closed channel.public boolean isActive()
true if channel is open and active; false otherwise.isOpen()public boolean isOpen()
true if open; false otherwise.isActive()public void removeAccelerometerListener()
public void setAccelerometerListener(AccelerometerListener l)
l - Listener for orientation or raw acceleration data.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.