|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.system.Sensor
public final class Sensor
Determines the existence and states of device sensors.
| Field Summary | ||
|---|---|---|
static int |
FLIP
Sensor ID of the flip sensor. |
|
static int |
HOLSTER
Sensor ID of the holster sensor. |
|
static int |
SLIDE
Sensor ID of the slider sensor. |
|
static int |
STATE_FLIP_CLOSED
A state of the flip sensor that indicates that the BlackBerry device flip is closed. |
|
static int |
STATE_FLIP_OPEN
A state of the flip sensor that indicates that the BlackBerry device flip is open. |
|
static int |
STATE_IN_HOLSTER
A state of the holster sensor that indicates that the BlackBerry device is in the holster. |
|
static int |
STATE_OUT_OF_HOLSTER
A state of the holster sensor that indicates that the BlackBerry device is not in the holster. |
|
static int |
STATE_SLIDE_CLOSED
A state of the slide sensor that indicates that the BlackBerry device slider is closed. |
|
static int |
STATE_SLIDE_IN_TRANSITION
A state of the slider sensor that indicates that the BlackBerry device slider is in transition between the open and closed states. |
|
static int |
STATE_SLIDE_OPEN
A state of the slide sensor that indicates that the BlackBerry device slider is open. |
|
| Method Summary | ||
|---|---|---|
static void |
addListener(Application app,
SensorListener listener,
int sensors)
Adds a listener that listens for changes to the state of device sensors. |
|
static int |
getState(int sensorId)
Returns the last known state of a sensor. |
|
static boolean |
isSupported(int sensorId)
Returns whether or not the BlackBerry device supports a specific sensor. |
|
static void |
removeListener(Application app,
SensorListener listener)
Removes a listener from the provided application's list of listeners. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int HOLSTER
public static final int FLIP
public static final int SLIDE
public static final int STATE_OUT_OF_HOLSTER
public static final int STATE_IN_HOLSTER
public static final int STATE_FLIP_OPEN
public static final int STATE_FLIP_CLOSED
public static final int STATE_SLIDE_OPEN
public static final int STATE_SLIDE_CLOSED
public static final int STATE_SLIDE_IN_TRANSITION
| Method Detail |
|---|
public static boolean isSupported(int sensorId)
sensorId - The ID of a sensor. One of Sensor.HOLSTER, Sensor.FLIP, or Sensor.SLIDE.
true if the sensor is present; false otherwise.public static int getState(int sensorId)
sensorId - The ID of a sensor. One of Sensor.HOLSTER, Sensor.FLIP, or Sensor.SLIDE.
IllegalArgumentException - If sensorId does not represent a supported sensor
public static void addListener(Application app,
SensorListener listener,
int sensors)
app - The Application that processes the listener notifications.listener - The SensorListener to receive changes to the state of device sensors.sensors - A bitwise OR of sensor IDs.
NullPointerException - If listener or app is null.
public static void removeListener(Application app,
SensorListener listener)
listener is null or is not on the provided
application's list of listeners, this method does nothing.
app - The Application that registered this listener.listener - The SensorListener to stop receiving changes to the state of device sensors.
NullPointerException - if app is null.
|
|||||||||
| 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