|
|||||||||
| 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 |
addAccelerometerListener(AccelerometerListener l)
Registers an accelerometer listener. |
|
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()
Deprecated. use AccelerometerSensor.Channel.removeAccelerometerListener( AccelerometerListener l ) |
|
void |
removeAccelerometerListener(AccelerometerListener l)
Deregisters an accelerometer listener. |
|
void |
setAccelerometerListener(AccelerometerListener l)
Deprecated. use AccelerometerSensor.Channel.addAccelerometerListener( AccelerometerListener l ). Historically this has behaved like
you'd expect AccelerometerSensor.Channel.addAccelerometerListener( AccelerometerListener l ) to, that is, support for multiple listeners. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void setAccelerometerListener(AccelerometerListener l)
AccelerometerSensor.Channel.addAccelerometerListener( AccelerometerListener l ). Historically this has behaved like
you'd expect AccelerometerSensor.Channel.addAccelerometerListener( AccelerometerListener l ) to, that is, support for multiple listeners.
l - Listener for orientation or raw acceleration data, must not be null.public void addAccelerometerListener(AccelerometerListener l)
l - Listener for orientation or raw acceleration data, must not be null.
NullPointerException - if listener is null
IllegalStateException - if the application that owns this channel no longer existspublic void removeAccelerometerListener()
AccelerometerSensor.Channel.removeAccelerometerListener( AccelerometerListener l )
public void removeAccelerometerListener(AccelerometerListener l)
l - Listener for orientation or raw acceleration data, could be nullpublic 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-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