Build 1.1_r1 (from source)

android.hardware
Class Sensor

java.lang.Object
  extended by android.hardware.Sensor

public class Sensor
extends Object

Class representing a sensor. Use SensorManager.getSensorList(int) to get the list of available Sensors.


Field Summary
static int TYPE_ACCELEROMETER
          A constant describing an accelerometer sensor type.
static int TYPE_ALL
          A constant describing all sensor types.
static int TYPE_GYROSCOPE
          A constant describing a gyroscope sensor type
static int TYPE_LIGHT
          A constant describing a light sensor type
static int TYPE_MAGNETIC_FIELD
          A constant describing a magnetic field sensor type.
static int TYPE_ORIENTATION
          A constant describing an orientation sensor type.
static int TYPE_PRESSURE
          A constant describing a pressure sensor type
static int TYPE_PROXIMITY
          A constant describing a proximity sensor type
static int TYPE_TEMPERATURE
          A constant describing a temperature sensor type
 
Constructor Summary
Sensor()
           
 
Method Summary
(package private)  int getHandle()
           
(package private)  int getLegacyType()
           
 float getMaximumRange()
           
 String getName()
           
 float getPower()
           
 float getResolution()
           
 int getType()
           
 String getVendor()
           
 int getVersion()
           
(package private)  void setLegacyType(int legacyType)
           
(package private)  void setRange(float max, float res)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_ACCELEROMETER

public static final int TYPE_ACCELEROMETER
A constant describing an accelerometer sensor type. See SensorEvent for more details.

See Also:
Constant Field Values

TYPE_MAGNETIC_FIELD

public static final int TYPE_MAGNETIC_FIELD
A constant describing a magnetic field sensor type. See SensorEvent for more details.

See Also:
Constant Field Values

TYPE_ORIENTATION

public static final int TYPE_ORIENTATION
A constant describing an orientation sensor type. See SensorEvent for more details.

See Also:
Constant Field Values

TYPE_GYROSCOPE

public static final int TYPE_GYROSCOPE
A constant describing a gyroscope sensor type

See Also:
Constant Field Values

TYPE_LIGHT

public static final int TYPE_LIGHT
A constant describing a light sensor type

See Also:
Constant Field Values

TYPE_PRESSURE

public static final int TYPE_PRESSURE
A constant describing a pressure sensor type

See Also:
Constant Field Values

TYPE_TEMPERATURE

public static final int TYPE_TEMPERATURE
A constant describing a temperature sensor type

See Also:
Constant Field Values

TYPE_PROXIMITY

public static final int TYPE_PROXIMITY
A constant describing a proximity sensor type

See Also:
Constant Field Values

TYPE_ALL

public static final int TYPE_ALL
A constant describing all sensor types.

See Also:
Constant Field Values
Constructor Detail

Sensor

Sensor()
Method Detail

getName

public String getName()
Returns:
name string of the sensor.

getVendor

public String getVendor()
Returns:
vendor string of this sensor.

getType

public int getType()
Returns:
generic type of this sensor.

getVersion

public int getVersion()
Returns:
version of the sensor's module.

getMaximumRange

public float getMaximumRange()
Returns:
maximum range of the sensor in the sensor's unit.

getResolution

public float getResolution()
Returns:
resolution of the sensor in the sensor's unit.

getPower

public float getPower()
Returns:
the power in mA used by this sensor while in use

getHandle

int getHandle()

setRange

void setRange(float max,
              float res)

setLegacyType

void setLegacyType(int legacyType)

getLegacyType

int getLegacyType()

Build 1.1_r1 (from source)

Please submit a feedback, bug or feature