|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.system.AccelerometerSensor.Channel
public static class AccelerometerSensor.Channel
Encapsulates an active connection to accelerometer sensor. While the channel
remains open the sensor is queried for samples. Invoke the AccelerometerSensor.Channel.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 setAccelerometerListener(AccelerometerListener l)
l - Listener for orientation or raw acceleration data.public void removeAccelerometerListener()
public void close()
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 OR the channel was opened for orientation data only
public AccelerometerData getAccelerometerData()
throws IllegalStateException
IllegalStateException - if called on a closed channel
public int getOrientation()
throws IllegalStateException
AccelerometerSensor.ORIENTATION_BACK_UP
IllegalStateException - if called on a closed channel OR the channel was opened for RAW data onlypublic boolean isActive()
true if channel is open and active; false otherwise.AccelerometerSensor.Channel.isOpen()public boolean isOpen()
true if open; false otherwise.AccelerometerSensor.Channel.isActive()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.