|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.os.Binder
android.view.IRotationWatcher.Stub
android.hardware.SensorManager
public class SensorManager
Class that lets you access the device's sensors. Get an instance of this
class by calling Context.getSystemService() with an argument of Context.SENSOR_SERVICE.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface android.view.IRotationWatcher |
|---|
IRotationWatcher.Stub |
| Nested classes/interfaces inherited from interface android.os.IBinder |
|---|
IBinder.DeathRecipient |
| Field Summary | |
|---|---|
static int |
DATA_X
Index of the X value in the array returned by SensorListener.onSensorChanged(int, float[]) |
static int |
DATA_Y
Index of the Y value in the array returned by SensorListener.onSensorChanged(int, float[]) |
static int |
DATA_Z
Index of the Z value in the array returned by SensorListener.onSensorChanged(int, float[]) |
static float |
GRAVITY_DEATH_STAR_I
|
static float |
GRAVITY_EARTH
|
static float |
GRAVITY_JUPITER
|
static float |
GRAVITY_MARS
|
static float |
GRAVITY_MERCURY
|
static float |
GRAVITY_MOON
|
static float |
GRAVITY_NEPTUN
|
static float |
GRAVITY_PLUTO
|
static float |
GRAVITY_SATURN
|
static float |
GRAVITY_SUN
values returned by the accelerometer in various locations in the universe. |
static float |
GRAVITY_THE_ISLAND
|
static float |
GRAVITY_URANUS
|
static float |
GRAVITY_VENUS
|
static float |
LIGHT_CLOUDY
|
static float |
LIGHT_FULLMOON
Various luminance values during the night (lux) |
static float |
LIGHT_NO_MOON
|
static float |
LIGHT_OVERCAST
|
static float |
LIGHT_SHADE
|
static float |
LIGHT_SUNLIGHT
|
static float |
LIGHT_SUNLIGHT_MAX
Various luminance values during the day (lux) |
static float |
LIGHT_SUNRISE
|
static float |
MAGNETIC_FIELD_EARTH_MAX
Maximum magnetic field on Earth's surface |
static float |
MAGNETIC_FIELD_EARTH_MIN
Minimum magnetic field on Earth's surface |
static int |
RAW_DATA_INDEX
Offset to the raw values in the array returned by SensorListener.onSensorChanged(int, float[]) |
static int |
RAW_DATA_X
Index of the raw X value in the array returned by SensorListener.onSensorChanged(int, float[]) |
static int |
RAW_DATA_Y
Index of the raw X value in the array returned by SensorListener.onSensorChanged(int, float[]) |
static int |
RAW_DATA_Z
Index of the raw X value in the array returned by SensorListener.onSensorChanged(int, float[]) |
static int |
SENSOR_ACCELEROMETER
A constant describing an accelerometer. |
static int |
SENSOR_ALL
A constant that includes all sensors |
static int |
SENSOR_DELAY_FASTEST
get sensor data as fast as possible |
static int |
SENSOR_DELAY_GAME
rate suitable for games |
static int |
SENSOR_DELAY_NORMAL
rate (default) suitable for screen orientation changes |
static int |
SENSOR_DELAY_UI
rate suitable for the user interface |
static int |
SENSOR_LIGHT
A constant describing an ambient light sensor Only the first value is defined for this sensor and it contains the ambient light measure in lux. |
static int |
SENSOR_MAGNETIC_FIELD
A constant describing a magnetic sensor Sensor values are the magnetic vector in the X, Y and Z axis, where the X axis has positive direction toward the right side of the device, the Y axis has positive direction toward the top of the device and the Z axis has positive direction toward the front of the device. |
static int |
SENSOR_MAX
Largest sensor ID |
static int |
SENSOR_MIN
Smallest sensor ID |
static int |
SENSOR_ORIENTATION
A constant describing an orientation sensor. |
static int |
SENSOR_ORIENTATION_RAW
A constant describing an orientation sensor. |
static int |
SENSOR_PROXIMITY
A constant describing a proximity sensor Only the first value is defined for this sensor and it contains the distance between the sensor and the object in meters (m) |
static int |
SENSOR_STATUS_ACCURACY_HIGH
This sensor is reporting data with maximum accuracy |
static int |
SENSOR_STATUS_ACCURACY_LOW
This sensor is reporting data with low accuracy, calibration with the environment is needed |
static int |
SENSOR_STATUS_ACCURACY_MEDIUM
This sensor is reporting data with an average level of accuracy, calibration with the environment may improve the readings |
static int |
SENSOR_STATUS_UNRELIABLE
The values returned by this sensor cannot be trusted, calibration is needed or the environment doesn't allow readings |
static int |
SENSOR_TEMPERATURE
A constant describing a temperature sensor Only the first value is defined for this sensor and it contains the ambient temperature in degree C. |
static int |
SENSOR_TRICORDER
A constant describing a Tricorder When this sensor is available and enabled, the device can be used as a fully functional Tricorder. |
static float |
STANDARD_GRAVITY
Standard gravity (g) on Earth. |
| Fields inherited from interface android.os.IBinder |
|---|
DUMP_TRANSACTION, FIRST_CALL_TRANSACTION, FLAG_ONEWAY, INTERFACE_TRANSACTION, LAST_CALL_TRANSACTION, PING_TRANSACTION |
| Constructor Summary | |
|---|---|
SensorManager(Looper mainLooper)
|
|
| Method Summary | |
|---|---|
int |
getSensors()
|
void |
onRotationChanged(int rotation)
|
boolean |
registerListener(SensorListener listener,
int sensors)
Registers a listener for given sensors. |
boolean |
registerListener(SensorListener listener,
int sensors,
int rate)
Registers a listener for given sensors. |
void |
unregisterListener(SensorListener listener)
Unregisters a listener for all sensors. |
void |
unregisterListener(SensorListener listener,
int sensors)
Unregisters a listener for the sensors with which it is registered. |
| Methods inherited from class android.view.IRotationWatcher.Stub |
|---|
asBinder, asInterface, onTransact |
| Methods inherited from class android.os.Binder |
|---|
attachInterface, clearCallingIdentity, dump, finalize, flushPendingCommands, getCallingPid, getCallingUid, getInterfaceDescriptor, isBinderAlive, joinThreadPool, linkToDeath, pingBinder, queryLocalInterface, restoreCallingIdentity, transact, unlinkToDeath |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SENSOR_ORIENTATION
public static final int SENSOR_ACCELEROMETER
public static final int SENSOR_TEMPERATURE
public static final int SENSOR_MAGNETIC_FIELD
public static final int SENSOR_LIGHT
public static final int SENSOR_PROXIMITY
public static final int SENSOR_TRICORDER
public static final int SENSOR_ORIENTATION_RAW
public static final int SENSOR_ALL
public static final int SENSOR_MIN
public static final int SENSOR_MAX
public static final int DATA_X
SensorListener.onSensorChanged(int, float[])
public static final int DATA_Y
SensorListener.onSensorChanged(int, float[])
public static final int DATA_Z
SensorListener.onSensorChanged(int, float[])
public static final int RAW_DATA_INDEX
SensorListener.onSensorChanged(int, float[])
public static final int RAW_DATA_X
SensorListener.onSensorChanged(int, float[])
public static final int RAW_DATA_Y
SensorListener.onSensorChanged(int, float[])
public static final int RAW_DATA_Z
SensorListener.onSensorChanged(int, float[])
public static final float STANDARD_GRAVITY
public static final float GRAVITY_SUN
public static final float GRAVITY_MERCURY
public static final float GRAVITY_VENUS
public static final float GRAVITY_EARTH
public static final float GRAVITY_MOON
public static final float GRAVITY_MARS
public static final float GRAVITY_JUPITER
public static final float GRAVITY_SATURN
public static final float GRAVITY_URANUS
public static final float GRAVITY_NEPTUN
public static final float GRAVITY_PLUTO
public static final float GRAVITY_DEATH_STAR_I
public static final float GRAVITY_THE_ISLAND
public static final float MAGNETIC_FIELD_EARTH_MAX
public static final float MAGNETIC_FIELD_EARTH_MIN
public static final float LIGHT_SUNLIGHT_MAX
public static final float LIGHT_SUNLIGHT
public static final float LIGHT_SHADE
public static final float LIGHT_OVERCAST
public static final float LIGHT_SUNRISE
public static final float LIGHT_CLOUDY
public static final float LIGHT_FULLMOON
public static final float LIGHT_NO_MOON
public static final int SENSOR_DELAY_FASTEST
public static final int SENSOR_DELAY_GAME
public static final int SENSOR_DELAY_UI
public static final int SENSOR_DELAY_NORMAL
public static final int SENSOR_STATUS_UNRELIABLE
public static final int SENSOR_STATUS_ACCURACY_LOW
public static final int SENSOR_STATUS_ACCURACY_MEDIUM
public static final int SENSOR_STATUS_ACCURACY_HIGH
| Constructor Detail |
|---|
public SensorManager(Looper mainLooper)
| Method Detail |
|---|
public int getSensors()
public boolean registerListener(SensorListener listener,
int sensors)
listener - sensor listener objectsensors - a bit masks of the sensors to register to
public boolean registerListener(SensorListener listener,
int sensors,
int rate)
listener - sensor listener objectsensors - a bit masks of the sensors to register torate - rate of events. This is only a hint to the system. events
may be received faster or slower than the specified rate. Usually events
are received faster.
public void unregisterListener(SensorListener listener,
int sensors)
listener - a SensorListener objectsensors - a bit masks of the sensors to unregister frompublic void unregisterListener(SensorListener listener)
listener - a SensorListener objectpublic void onRotationChanged(int rotation)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||