FileDocCategorySizeDatePackage
Sensor.javaAPI DocAndroid 1.5 API3762Wed May 06 22:41:54 BST 2009android.hardware

Sensor

public class Sensor extends Object
Class representing a sensor. Use {@link SensorManager#getSensorList} to get the list of available Sensors.

Fields Summary
public static final int
TYPE_ACCELEROMETER
A constant describing an accelerometer sensor type. See {@link android.hardware.SensorEvent SensorEvent} for more details.
public static final int
TYPE_MAGNETIC_FIELD
A constant describing a magnetic field sensor type. See {@link android.hardware.SensorEvent SensorEvent} for more details.
public static final int
TYPE_ORIENTATION
A constant describing an orientation sensor type. See {@link android.hardware.SensorEvent SensorEvent} for more details.
public static final int
TYPE_GYROSCOPE
A constant describing a gyroscope sensor type
public static final int
TYPE_LIGHT
A constant describing a light sensor type
public static final int
TYPE_PRESSURE
A constant describing a pressure sensor type
public static final int
TYPE_TEMPERATURE
A constant describing a temperature sensor type
public static final int
TYPE_PROXIMITY
A constant describing a proximity sensor type
public static final int
TYPE_ALL
A constant describing all sensor types.
private String
mName
private String
mVendor
private int
mVersion
private int
mHandle
private int
mType
private float
mMaxRange
private float
mResolution
private float
mPower
private int
mLegacyType
Constructors Summary
Sensor()

    
    
     
    
Methods Summary
intgetHandle()

        return mHandle;
    
intgetLegacyType()

        return mLegacyType;
    
public floatgetMaximumRange()

return
maximum range of the sensor in the sensor's unit.

        return mMaxRange;
    
public java.lang.StringgetName()

return
name string of the sensor.

        return mName;
    
public floatgetPower()

return
the power in mA used by this sensor while in use

        return mPower;
    
public floatgetResolution()

return
resolution of the sensor in the sensor's unit.

        return mResolution;
    
public intgetType()

return
generic type of this sensor.

        return mType;
    
public java.lang.StringgetVendor()

return
vendor string of this sensor.

        return mVendor;
    
public intgetVersion()

return
version of the sensor's module.

        return mVersion;
    
voidsetLegacyType(int legacyType)

        mLegacyType = legacyType;
    
voidsetRange(float max, float res)

        mMaxRange = max;
        mResolution = res;