Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/hardware/SensorManager#nestedclasses) \| [Constants](https://developer.android.com/reference/android/hardware/SensorManager#constants) \| [Methods](https://developer.android.com/reference/android/hardware/SensorManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/SensorManager#inhmethods)

# SensorManager

*** ** * ** ***

` public abstract class SensorManager `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.SensorManager |

<br />

*** ** * ** ***

<br />

SensorManager lets you access the device's `https://developer.android.com/reference/android/hardware/Sensor`.

Always make sure to disable sensors you don't need, especially when your activity is paused. Failing to do so can drain the battery in just a few hours. Note that the system will *not* disable sensors automatically when the screen turns off.

Note: Don't use this mechanism with a Trigger Sensor, have a look at `https://developer.android.com/reference/android/hardware/TriggerEventListener`. `https://developer.android.com/reference/android/hardware/Sensor#TYPE_SIGNIFICANT_MOTION` is an example of a trigger sensor.

In order to access sensor data at high sampling rates (i.e. greater than 200 Hz for `https://developer.android.com/reference/android/hardware/SensorEventListener` and greater than `https://developer.android.com/reference/android/hardware/SensorDirectChannel#RATE_NORMAL` for `https://developer.android.com/reference/android/hardware/SensorDirectChannel`), apps must declare the `https://developer.android.com/reference/android/Manifest.permission#HIGH_SAMPLING_RATE_SENSORS` permission in their AndroidManifest.xml file.

```
public class SensorActivity extends Activity implements SensorEventListener {
    private final SensorManager mSensorManager;
    private final Sensor mAccelerometer;

    public SensorActivity() {
        mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
        mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
    }

    protected void onResume() {
        super.onResume();
        mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
    }

    protected void onPause() {
        super.onPause();
        mSensorManager.unregisterListener(this);
    }

    public void onAccuracyChanged(Sensor sensor, int accuracy) {
    }

    public void onSensorChanged(SensorEvent event) {
    }
}
```

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorEventListener`
- `https://developer.android.com/reference/android/hardware/SensorEvent`
- `https://developer.android.com/reference/android/hardware/Sensor`

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback` Used for receiving notifications from the SensorManager when dynamic sensors are connected or disconnected. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#AXIS_MINUS_X` see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])` |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#AXIS_MINUS_Y` see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])` |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#AXIS_MINUS_Z` see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])` |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#AXIS_X` see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])` |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#AXIS_Y` see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])` |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#AXIS_Z` see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])` |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#DATA_X` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#DATA_Y` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#DATA_Z` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_DEATH_STAR_I` Gravity (estimate) on the first Death Star in Empire units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_EARTH` Earth's gravity in SI units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_JUPITER` Jupiter's gravity in SI units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_MARS` Mars' gravity in SI units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_MERCURY` Mercury's gravity in SI units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_MOON` The Moon's gravity in SI units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_NEPTUNE` Neptune's gravity in SI units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_PLUTO` Pluto's gravity in SI units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_SATURN` Saturn's gravity in SI units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_SUN` Sun's gravity in SI units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_THE_ISLAND` Gravity on the island |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_URANUS` Uranus' gravity in SI units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#GRAVITY_VENUS` Venus' gravity in SI units (m/s\^2) |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#LIGHT_CLOUDY` luminance under a cloudy sky in lux |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#LIGHT_FULLMOON` luminance at night with full moon in lux |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#LIGHT_NO_MOON` luminance at night with no moon in lux |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#LIGHT_OVERCAST` luminance under an overcast sky in lux |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#LIGHT_SHADE` luminance in shade in lux |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#LIGHT_SUNLIGHT` luminance of sunlight in lux |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#LIGHT_SUNLIGHT_MAX` Maximum luminance of sunlight in lux |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#LIGHT_SUNRISE` luminance at sunrise in lux |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#MAGNETIC_FIELD_EARTH_MAX` Maximum magnetic field on Earth's surface |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#MAGNETIC_FIELD_EARTH_MIN` Minimum magnetic field on Earth's surface |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#PRESSURE_STANDARD_ATMOSPHERE` Standard atmosphere, or average sea-level pressure in hPa (millibar) |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#RAW_DATA_INDEX` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#RAW_DATA_X` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#RAW_DATA_Y` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#RAW_DATA_Z` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_ACCELEROMETER` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_ALL` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_FASTEST` get sensor data as fast as possible |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_GAME` rate suitable for games |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_NORMAL` rate (default) suitable for screen orientation changes |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_UI` rate suitable for the user interface |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_LIGHT` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_MAGNETIC_FIELD` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_MAX` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_MIN` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_ORIENTATION` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_ORIENTATION_RAW` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_PROXIMITY` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_STATUS_ACCURACY_HIGH` This sensor is reporting data with maximum accuracy |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_STATUS_ACCURACY_LOW` This sensor is reporting data with low accuracy, calibration with the environment is needed |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_STATUS_ACCURACY_MEDIUM` This sensor is reporting data with an average level of accuracy, calibration with the environment may improve the readings |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_STATUS_NO_CONTACT` The values returned by this sensor cannot be trusted because the sensor had no contact with what it was measuring (for example, the heart rate monitor is not in contact with the user). |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_STATUS_UNRELIABLE` The values returned by this sensor cannot be trusted, calibration is needed or the environment doesn't allow readings |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_TEMPERATURE` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_TRICORDER` *This constant was deprecated in API level 15. use `https://developer.android.com/reference/android/hardware/Sensor` instead.* |
| `float` | `https://developer.android.com/reference/android/hardware/SensorManager#STANDARD_GRAVITY` Standard gravity (g) on Earth. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#cancelTriggerSensor(android.hardware.TriggerEventListener,%20android.hardware.Sensor)(https://developer.android.com/reference/android/hardware/TriggerEventListener listener, https://developer.android.com/reference/android/hardware/Sensor sensor) ` Cancels receiving trigger events for a trigger sensor. |
| ` https://developer.android.com/reference/android/hardware/SensorDirectChannel` | ` https://developer.android.com/reference/android/hardware/SensorManager#createDirectChannel(android.os.MemoryFile)(https://developer.android.com/reference/android/os/MemoryFile mem) ` Create a sensor direct channel backed by shared memory wrapped in MemoryFile object. |
| ` https://developer.android.com/reference/android/hardware/SensorDirectChannel` | ` https://developer.android.com/reference/android/hardware/SensorManager#createDirectChannel(android.hardware.HardwareBuffer)(https://developer.android.com/reference/android/hardware/HardwareBuffer mem) ` Create a sensor direct channel backed by shared memory wrapped in HardwareBuffer object. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#flush(android.hardware.SensorEventListener)(https://developer.android.com/reference/android/hardware/SensorEventListener listener) ` Flushes the FIFO of all the sensors registered for this listener. |
| ` static float` | ` https://developer.android.com/reference/android/hardware/SensorManager#getAltitude(float,%20float)(float p0, float p) ` Computes the Altitude in meters from the atmospheric pressure and the pressure at sea level. |
| ` static void` | ` https://developer.android.com/reference/android/hardware/SensorManager#getAngleChange(float[],%20float[],%20float[])(float[] angleChange, float[] R, float[] prevR) ` Helper function to compute the angle change between two rotation matrices. |
| ` https://developer.android.com/reference/android/hardware/Sensor` | ` https://developer.android.com/reference/android/hardware/SensorManager#getDefaultSensor(int)(int type) ` Use this method to get the default sensor for a given type. |
| ` https://developer.android.com/reference/android/hardware/Sensor` | ` https://developer.android.com/reference/android/hardware/SensorManager#getDefaultSensor(int,%20boolean)(int type, boolean wakeUp) ` Return a Sensor with the given type and wakeUp properties. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/hardware/Sensor>` | ` https://developer.android.com/reference/android/hardware/SensorManager#getDynamicSensorList(int)(int type) ` Use this method to get a list of available dynamic sensors of a certain type. |
| ` static float` | ` https://developer.android.com/reference/android/hardware/SensorManager#getInclination(float[])(float[] I) ` Computes the geomagnetic inclination angle in radians from the inclination matrix **I** returned by `https://developer.android.com/reference/android/hardware/SensorManager#getRotationMatrix(float[],%20float[],%20float[],%20float[])`. |
| ` static float[]` | ` https://developer.android.com/reference/android/hardware/SensorManager#getOrientation(float[],%20float[])(float[] R, float[] values) ` Computes the device's orientation based on the rotation matrix. |
| ` static void` | ` https://developer.android.com/reference/android/hardware/SensorManager#getQuaternionFromVector(float[],%20float[])(float[] Q, float[] rv) ` Helper function to convert a rotation vector to a normalized quaternion. |
| ` static boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#getRotationMatrix(float[],%20float[],%20float[],%20float[])(float[] R, float[] I, float[] gravity, float[] geomagnetic) ` <br /> Computes the inclination matrix **I** as well as the rotation matrix **R** transforming a vector from the device coordinate system to the world's coordinate system which is defined as a direct orthonormal basis, where: - X is defined as the vector product **Y.Z** (It is tangential to the ground at the device's current location and roughly points East). <br /> |
| ` static void` | ` https://developer.android.com/reference/android/hardware/SensorManager#getRotationMatrixFromVector(float[],%20float[])(float[] R, float[] rotationVector) ` Helper function to convert a rotation vector to a rotation matrix. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/hardware/Sensor>` | ` https://developer.android.com/reference/android/hardware/SensorManager#getSensorList(int)(int type) ` Use this method to get the list of available sensors of a certain type. |
| ` int` | ` https://developer.android.com/reference/android/hardware/SensorManager#getSensors()() ` *This method was deprecated in API level 15. This method is deprecated, use `https://developer.android.com/reference/android/hardware/SensorManager#getSensorList(int)` instead* |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#isDynamicSensorDiscoverySupported()() ` Tell if dynamic sensor discovery feature is supported by system. |
| ` void` | ` https://developer.android.com/reference/android/hardware/SensorManager#registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorCallback)(https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback callback) ` Add a `https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback` to receive dynamic sensor connection callbacks. |
| ` void` | ` https://developer.android.com/reference/android/hardware/SensorManager#registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorCallback,%20android.os.Handler)(https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback callback, https://developer.android.com/reference/android/os/Handler handler) ` Add a `https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback` to receive dynamic sensor connection callbacks. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)(https://developer.android.com/reference/android/hardware/SensorEventListener listener, https://developer.android.com/reference/android/hardware/Sensor sensor, int samplingPeriodUs) ` Registers a `https://developer.android.com/reference/android/hardware/SensorEventListener` for the given sensor at the given sampling frequency. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int,%20int)(https://developer.android.com/reference/android/hardware/SensorEventListener listener, https://developer.android.com/reference/android/hardware/Sensor sensor, int samplingPeriodUs, int maxReportLatencyUs) ` Registers a `https://developer.android.com/reference/android/hardware/SensorEventListener` for the given sensor at the given sampling frequency and the given maximum reporting latency. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int,%20android.os.Handler)(https://developer.android.com/reference/android/hardware/SensorEventListener listener, https://developer.android.com/reference/android/hardware/Sensor sensor, int samplingPeriodUs, https://developer.android.com/reference/android/os/Handler handler) ` Registers a `https://developer.android.com/reference/android/hardware/SensorEventListener` for the given sensor. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorListener,%20int)(https://developer.android.com/reference/android/hardware/SensorListener listener, int sensors) ` *This method was deprecated in API level 15. This method is deprecated, use `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)` instead.* |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorListener,%20int,%20int)(https://developer.android.com/reference/android/hardware/SensorListener listener, int sensors, int rate) ` *This method was deprecated in API level 15. This method is deprecated, use `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)` instead.* |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int,%20int,%20android.os.Handler)(https://developer.android.com/reference/android/hardware/SensorEventListener listener, https://developer.android.com/reference/android/hardware/Sensor sensor, int samplingPeriodUs, int maxReportLatencyUs, https://developer.android.com/reference/android/os/Handler handler) ` Registers a `https://developer.android.com/reference/android/hardware/SensorEventListener` for the given sensor at the given sampling frequency and the given maximum reporting latency. |
| ` static boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])(float[] inR, int X, int Y, float[] outR) ` <br /> Rotates the supplied rotation matrix so it is expressed in a different coordinate system. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/SensorManager#requestTriggerSensor(android.hardware.TriggerEventListener,%20android.hardware.Sensor)(https://developer.android.com/reference/android/hardware/TriggerEventListener listener, https://developer.android.com/reference/android/hardware/Sensor sensor) ` Requests receiving trigger events for a trigger sensor. |
| ` void` | ` https://developer.android.com/reference/android/hardware/SensorManager#unregisterDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorCallback)(https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback callback) ` Remove a `https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback` to stop sending dynamic sensor connection events to that callback. |
| ` void` | ` https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener)(https://developer.android.com/reference/android/hardware/SensorEventListener listener) ` Unregisters a listener for all sensors. |
| ` void` | ` https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener,%20android.hardware.Sensor)(https://developer.android.com/reference/android/hardware/SensorEventListener listener, https://developer.android.com/reference/android/hardware/Sensor sensor) ` Unregisters a listener for the sensors with which it is registered. |
| ` void` | ` https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorListener)(https://developer.android.com/reference/android/hardware/SensorListener listener) ` *This method was deprecated in API level 15. This method is deprecated, use `https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener)` instead.* |
| ` void` | ` https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorListener,%20int)(https://developer.android.com/reference/android/hardware/SensorListener listener, int sensors) ` *This method was deprecated in API level 15. This method is deprecated, use `https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener,%20android.hardware.Sensor)` instead.* |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### AXIS_MINUS_X

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int AXIS_MINUS_X
```

see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])`

<br />

Constant Value: 129 (0x00000081)

### AXIS_MINUS_Y

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int AXIS_MINUS_Y
```

see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])`

<br />

Constant Value: 130 (0x00000082)

### AXIS_MINUS_Z

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int AXIS_MINUS_Z
```

see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])`

<br />

Constant Value: 131 (0x00000083)

### AXIS_X

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int AXIS_X
```

see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])`

<br />

Constant Value: 1 (0x00000001)

### AXIS_Y

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int AXIS_Y
```

see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])`

<br />

Constant Value: 2 (0x00000002)

### AXIS_Z

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int AXIS_Z
```

see `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])`

<br />

Constant Value: 3 (0x00000003)

### DATA_X

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DATA_X
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

Index of the X value in the array returned by `https://developer.android.com/reference/android/hardware/SensorListener#onSensorChanged(int,%20float[])`

<br />

Constant Value: 0 (0x00000000)

### DATA_Y

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DATA_Y
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

Index of the Y value in the array returned by `https://developer.android.com/reference/android/hardware/SensorListener#onSensorChanged(int,%20float[])`

<br />

Constant Value: 1 (0x00000001)

### DATA_Z

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DATA_Z
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

Index of the Z value in the array returned by `https://developer.android.com/reference/android/hardware/SensorListener#onSensorChanged(int,%20float[])`

<br />

Constant Value: 2 (0x00000002)

### GRAVITY_DEATH_STAR_I

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_DEATH_STAR_I
```

Gravity (estimate) on the first Death Star in Empire units (m/s\^2)

<br />

Constant Value: 3.5303614E-7

### GRAVITY_EARTH

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_EARTH
```

Earth's gravity in SI units (m/s\^2)

<br />

Constant Value: 9.80665

### GRAVITY_JUPITER

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_JUPITER
```

Jupiter's gravity in SI units (m/s\^2)

<br />

Constant Value: 23.12

### GRAVITY_MARS

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_MARS
```

Mars' gravity in SI units (m/s\^2)

<br />

Constant Value: 3.71

### GRAVITY_MERCURY

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_MERCURY
```

Mercury's gravity in SI units (m/s\^2)

<br />

Constant Value: 3.7

### GRAVITY_MOON

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_MOON
```

The Moon's gravity in SI units (m/s\^2)

<br />

Constant Value: 1.6

### GRAVITY_NEPTUNE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_NEPTUNE
```

Neptune's gravity in SI units (m/s\^2)

<br />

Constant Value: 11.0

### GRAVITY_PLUTO

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_PLUTO
```

Pluto's gravity in SI units (m/s\^2)

<br />

Constant Value: 0.6

### GRAVITY_SATURN

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_SATURN
```

Saturn's gravity in SI units (m/s\^2)

<br />

Constant Value: 8.96

### GRAVITY_SUN

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_SUN
```

Sun's gravity in SI units (m/s\^2)

<br />

Constant Value: 275.0

### GRAVITY_THE_ISLAND

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_THE_ISLAND
```

Gravity on the island

<br />

Constant Value: 4.815162

### GRAVITY_URANUS

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_URANUS
```

Uranus' gravity in SI units (m/s\^2)

<br />

Constant Value: 8.69

### GRAVITY_VENUS

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float GRAVITY_VENUS
```

Venus' gravity in SI units (m/s\^2)

<br />

Constant Value: 8.87

### LIGHT_CLOUDY

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float LIGHT_CLOUDY
```

luminance under a cloudy sky in lux

<br />

Constant Value: 100.0

### LIGHT_FULLMOON

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float LIGHT_FULLMOON
```

luminance at night with full moon in lux

<br />

Constant Value: 0.25

### LIGHT_NO_MOON

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float LIGHT_NO_MOON
```

luminance at night with no moon in lux

<br />

Constant Value: 0.001

### LIGHT_OVERCAST

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float LIGHT_OVERCAST
```

luminance under an overcast sky in lux

<br />

Constant Value: 10000.0

### LIGHT_SHADE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float LIGHT_SHADE
```

luminance in shade in lux

<br />

Constant Value: 20000.0

### LIGHT_SUNLIGHT

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float LIGHT_SUNLIGHT
```

luminance of sunlight in lux

<br />

Constant Value: 110000.0

### LIGHT_SUNLIGHT_MAX

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float LIGHT_SUNLIGHT_MAX
```

Maximum luminance of sunlight in lux

<br />

Constant Value: 120000.0

### LIGHT_SUNRISE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float LIGHT_SUNRISE
```

luminance at sunrise in lux

<br />

Constant Value: 400.0

### MAGNETIC_FIELD_EARTH_MAX

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float MAGNETIC_FIELD_EARTH_MAX
```

Maximum magnetic field on Earth's surface

<br />

Constant Value: 60.0

### MAGNETIC_FIELD_EARTH_MIN

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float MAGNETIC_FIELD_EARTH_MIN
```

Minimum magnetic field on Earth's surface

<br />

Constant Value: 30.0

### PRESSURE_STANDARD_ATMOSPHERE

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float PRESSURE_STANDARD_ATMOSPHERE
```

Standard atmosphere, or average sea-level pressure in hPa (millibar)

<br />

Constant Value: 1013.25

### RAW_DATA_INDEX

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RAW_DATA_INDEX
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

Offset to the untransformed values in the array returned by `https://developer.android.com/reference/android/hardware/SensorListener#onSensorChanged(int,%20float[])`

<br />

Constant Value: 3 (0x00000003)

### RAW_DATA_X

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RAW_DATA_X
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

Index of the untransformed X value in the array returned by `https://developer.android.com/reference/android/hardware/SensorListener#onSensorChanged(int,%20float[])`

<br />

Constant Value: 3 (0x00000003)

### RAW_DATA_Y

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RAW_DATA_Y
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

Index of the untransformed Y value in the array returned by `https://developer.android.com/reference/android/hardware/SensorListener#onSensorChanged(int,%20float[])`

<br />

Constant Value: 4 (0x00000004)

### RAW_DATA_Z

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RAW_DATA_Z
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

Index of the untransformed Z value in the array returned by `https://developer.android.com/reference/android/hardware/SensorListener#onSensorChanged(int,%20float[])`

<br />

Constant Value: 5 (0x00000005)

### SENSOR_ACCELEROMETER

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_ACCELEROMETER
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

A constant describing an accelerometer. See `https://developer.android.com/reference/android/hardware/SensorListener` for more details.

<br />

Constant Value: 2 (0x00000002)

### SENSOR_ALL

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_ALL
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

A constant that includes all sensors

<br />

Constant Value: 127 (0x0000007f)

### SENSOR_DELAY_FASTEST

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_DELAY_FASTEST
```

get sensor data as fast as possible

<br />

Constant Value: 0 (0x00000000)

### SENSOR_DELAY_GAME

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_DELAY_GAME
```

rate suitable for games

<br />

Constant Value: 1 (0x00000001)

### SENSOR_DELAY_NORMAL

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_DELAY_NORMAL
```

rate (default) suitable for screen orientation changes

<br />

Constant Value: 3 (0x00000003)

### SENSOR_DELAY_UI

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_DELAY_UI
```

rate suitable for the user interface

<br />

Constant Value: 2 (0x00000002)

### SENSOR_LIGHT

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_LIGHT
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

A constant describing an ambient light sensor See `https://developer.android.com/reference/android/hardware/SensorListener` for more details.

<br />

Constant Value: 16 (0x00000010)

### SENSOR_MAGNETIC_FIELD

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_MAGNETIC_FIELD
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

A constant describing a magnetic sensor See `https://developer.android.com/reference/android/hardware/SensorListener` for more details.

<br />

Constant Value: 8 (0x00000008)

### SENSOR_MAX

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_MAX
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

Largest sensor ID

<br />

Constant Value: 64 (0x00000040)

### SENSOR_MIN

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_MIN
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

Smallest sensor ID

<br />

Constant Value: 1 (0x00000001)

### SENSOR_ORIENTATION

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_ORIENTATION
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

A constant describing an orientation sensor. See `https://developer.android.com/reference/android/hardware/SensorListener` for more details.

<br />

Constant Value: 1 (0x00000001)

### SENSOR_ORIENTATION_RAW

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_ORIENTATION_RAW
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

A constant describing an orientation sensor. See `https://developer.android.com/reference/android/hardware/SensorListener` for more details.

<br />

Constant Value: 128 (0x00000080)

### SENSOR_PROXIMITY

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_PROXIMITY
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

A constant describing a proximity sensor See `https://developer.android.com/reference/android/hardware/SensorListener` for more details.

<br />

Constant Value: 32 (0x00000020)

### SENSOR_STATUS_ACCURACY_HIGH

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_STATUS_ACCURACY_HIGH
```

This sensor is reporting data with maximum accuracy

<br />

Constant Value: 3 (0x00000003)

### SENSOR_STATUS_ACCURACY_LOW

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_STATUS_ACCURACY_LOW
```

This sensor is reporting data with low accuracy, calibration with the environment is needed

<br />

Constant Value: 1 (0x00000001)

### SENSOR_STATUS_ACCURACY_MEDIUM

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_STATUS_ACCURACY_MEDIUM
```

This sensor is reporting data with an average level of accuracy, calibration with the environment may improve the readings

<br />

Constant Value: 2 (0x00000002)

### SENSOR_STATUS_NO_CONTACT

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_STATUS_NO_CONTACT
```

The values returned by this sensor cannot be trusted because the sensor had no contact with what it was measuring (for example, the heart rate monitor is not in contact with the user).

<br />

Constant Value: -1 (0xffffffff)

### SENSOR_STATUS_UNRELIABLE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_STATUS_UNRELIABLE
```

The values returned by this sensor cannot be trusted, calibration is needed or the environment doesn't allow readings

<br />

Constant Value: 0 (0x00000000)

### SENSOR_TEMPERATURE

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_TEMPERATURE
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

A constant describing a temperature sensor See `https://developer.android.com/reference/android/hardware/SensorListener` for more details.

<br />

Constant Value: 4 (0x00000004)

### SENSOR_TRICORDER

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SENSOR_TRICORDER
```

<br />

**This constant was deprecated in API level 15.**   

use `https://developer.android.com/reference/android/hardware/Sensor` instead.

A constant describing a Tricorder See `https://developer.android.com/reference/android/hardware/SensorListener` for more details.

<br />

Constant Value: 64 (0x00000040)

### STANDARD_GRAVITY

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final float STANDARD_GRAVITY
```

Standard gravity (g) on Earth. This value is equivalent to 1G

<br />

Constant Value: 9.80665

## Public methods

### cancelTriggerSensor

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean cancelTriggerSensor (TriggerEventListener listener, 
                Sensor sensor)
```

Cancels receiving trigger events for a trigger sensor.

Note that a Trigger sensor will be auto disabled if `https://developer.android.com/reference/android/hardware/TriggerEventListener#onTrigger(android.hardware.TriggerEvent)` has triggered. This method is provided in case the user wants to explicitly cancel the request to receive trigger events.

<br />

<br />

| Parameters ||
|---|---|
| `listener` | `TriggerEventListener`: The listener on which the `https://developer.android.com/reference/android/hardware/TriggerEventListener#onTrigger(android.hardware.TriggerEvent)` is delivered.It should be the same as the one used in `https://developer.android.com/reference/android/hardware/SensorManager#requestTriggerSensor(android.hardware.TriggerEventListener,%20android.hardware.Sensor)` <br /> |
| `sensor` | `Sensor`: The sensor for which the trigger request should be canceled. If null, it cancels receiving trigger for all sensors associated with the listener. <br /> |

| Returns ||
|---|---|
| `boolean` | true if successfully canceled. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | when sensor is a trigger sensor. |

### createDirectChannel

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SensorDirectChannel createDirectChannel (MemoryFile mem)
```

Create a sensor direct channel backed by shared memory wrapped in MemoryFile object. The resulting channel can be used for delivering sensor events to native code, other processes, GPU/DSP or other co-processors without CPU intervention. This is the recommended for high performance sensor applications that use high sensor rates (e.g. greater than 200Hz) and cares about sensor event latency. Use the returned `https://developer.android.com/reference/android/hardware/SensorDirectChannel` object to configure direct report of sensor events. After use, call `https://developer.android.com/reference/android/hardware/SensorDirectChannel#close()` to free up resource in sensor system associated with the direct channel.

<br />

| Parameters ||
|---|---|
| `mem` | `MemoryFile`: A `https://developer.android.com/reference/android/os/MemoryFile` shared memory object. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/hardware/SensorDirectChannel` | A `https://developer.android.com/reference/android/hardware/SensorDirectChannel` object. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/UncheckedIOException` | if not able to create channel. |
| `https://developer.android.com/reference/java/lang/NullPointerException` | when mem is null. |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorDirectChannel#close()`

### createDirectChannel

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SensorDirectChannel createDirectChannel (HardwareBuffer mem)
```

Create a sensor direct channel backed by shared memory wrapped in HardwareBuffer object. The resulting channel can be used for delivering sensor events to native code, other processes, GPU/DSP or other co-processors without CPU intervention. This is the recommended for high performance sensor applications that use high sensor rates (e.g. greater than 200Hz) and cares about sensor event latency. Use the returned `https://developer.android.com/reference/android/hardware/SensorDirectChannel` object to configure direct report of sensor events. After use, call `https://developer.android.com/reference/android/hardware/SensorDirectChannel#close()` to free up resource in sensor system associated with the direct channel.

<br />

| Parameters ||
|---|---|
| `mem` | `HardwareBuffer`: A `https://developer.android.com/reference/android/hardware/HardwareBuffer` shared memory object. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/hardware/SensorDirectChannel` | A `https://developer.android.com/reference/android/hardware/SensorDirectChannel` object. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/UncheckedIOException` | if not able to create channel. |
| `https://developer.android.com/reference/java/lang/NullPointerException` | when mem is null. |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorDirectChannel#close()`

### flush

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean flush (SensorEventListener listener)
```

Flushes the FIFO of all the sensors registered for this listener. If there are events in the FIFO of the sensor, they are returned as if the maxReportLatency of the FIFO has expired. Events are returned in the usual way through the SensorEventListener. This call doesn't affect the maxReportLatency for this sensor. This call is asynchronous and returns immediately. `https://developer.android.com/reference/android/hardware/SensorEventListener2#onFlushCompleted(android.hardware.Sensor)` is called after all the events in the batch at the time of calling this method have been delivered successfully. If the hardware doesn't support flush, it still returns true and a trivial flush complete event is sent after the current event for all the clients registered for this sensor.

<br />

| Parameters ||
|---|---|
| `listener` | `SensorEventListener`: A `https://developer.android.com/reference/android/hardware/SensorEventListener` object which was previously used in a registerListener call. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the flush is initiated successfully on all the sensors registered for this listener, false if no sensor is previously registered for this listener or flush on one of the sensors fails. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | when listener is null. |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int,%20int)`

### getAltitude

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static float getAltitude (float p0, 
                float p)
```

Computes the Altitude in meters from the atmospheric pressure and the pressure at sea level.

Typically the atmospheric pressure is read from a `https://developer.android.com/reference/android/hardware/Sensor#TYPE_PRESSURE` sensor. The pressure at sea level must be known, usually it can be retrieved from airport databases in the vicinity. If unknown, you can use `https://developer.android.com/reference/android/hardware/SensorManager#PRESSURE_STANDARD_ATMOSPHERE` as an approximation, but absolute altitudes won't be accurate.

To calculate altitude differences, you must calculate the difference between the altitudes at both points. If you don't know the altitude as sea level, you can use `https://developer.android.com/reference/android/hardware/SensorManager#PRESSURE_STANDARD_ATMOSPHERE` instead, which will give good results considering the range of pressure typically involved.

` float altitude_difference = getAltitude(SensorManager.PRESSURE_STANDARD_ATMOSPHERE, pressure_at_point2) - getAltitude(SensorManager.PRESSURE_STANDARD_ATMOSPHERE, pressure_at_point1); `

<br />

<br />

<br />

| Parameters ||
|---|---|
| `p0` | `float`: pressure at sea level <br /> |
| `p` | `float`: atmospheric pressure <br /> |

| Returns ||
|---|---|
| `float` | Altitude in meters <br /> |

### getAngleChange

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void getAngleChange (float[] angleChange, 
                float[] R, 
                float[] prevR)
```

Helper function to compute the angle change between two rotation matrices. Given a current rotation matrix (R) and a previous rotation matrix (prevR) computes the intrinsic rotation around the z, x, and y axes which transforms prevR to R. outputs a 3 element vector containing the z, x, and y angle change at indexes 0, 1, and 2 respectively.

Each input matrix is either as a 3x3 or 4x4 row-major matrix depending on the length of the passed array:

If the array length is 9, then the array elements represent this matrix

```
   /  R[ 0]   R[ 1]   R[ 2]   \
   |  R[ 3]   R[ 4]   R[ 5]   |
   \  R[ 6]   R[ 7]   R[ 8]   /
```

If the array length is 16, then the array elements represent this matrix

```
   /  R[ 0]   R[ 1]   R[ 2]   R[ 3]  \
   |  R[ 4]   R[ 5]   R[ 6]   R[ 7]  |
   |  R[ 8]   R[ 9]   R[10]   R[11]  |
   \  R[12]   R[13]   R[14]   R[15]  /
```
See `https://developer.android.com/reference/android/hardware/SensorManager#getOrientation(float[],%20float[])` for more detailed definition of the output.

<br />

<br />

| Parameters ||
|---|---|
| `angleChange` | `float`: an an array of floats (z, x, and y) in which the angle change (in radians) is stored <br /> |
| `R` | `float`: current rotation matrix <br /> |
| `prevR` | `float`: previous rotation matrix <br /> |

### getDefaultSensor

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Sensor getDefaultSensor (int type)
```

Use this method to get the default sensor for a given type. Note that the returned sensor could be a composite sensor, and its data could be averaged or filtered. If you need to access the raw sensors use `https://developer.android.com/reference/android/hardware/SensorManager#getSensorList(int)`.

<br />

| Parameters ||
|---|---|
| `type` | `int`: of sensors requested <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/hardware/Sensor` | the default sensor matching the requested type if one exists and the application has the necessary permissions, or null otherwise. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#getSensorList(int)`
- `https://developer.android.com/reference/android/hardware/Sensor`

### getDefaultSensor

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Sensor getDefaultSensor (int type, 
                boolean wakeUp)
```

Return a Sensor with the given type and wakeUp properties. If multiple sensors of this type exist, any one of them may be returned.

For example,

- getDefaultSensor(`https://developer.android.com/reference/android/hardware/Sensor#TYPE_ACCELEROMETER`, true) returns a wake-up accelerometer sensor if it exists.
- getDefaultSensor(`https://developer.android.com/reference/android/hardware/Sensor#TYPE_PROXIMITY`, false) returns a non wake-up proximity sensor if it exists.
- getDefaultSensor(`https://developer.android.com/reference/android/hardware/Sensor#TYPE_PROXIMITY`, true) returns a wake-up proximity sensor which is the same as the Sensor returned by `https://developer.android.com/reference/android/hardware/SensorManager#getDefaultSensor(int)`.

<br />

Note: Sensors like `https://developer.android.com/reference/android/hardware/Sensor#TYPE_PROXIMITY` and `https://developer.android.com/reference/android/hardware/Sensor#TYPE_SIGNIFICANT_MOTION` are declared as wake-up sensors by default.

<br />

<br />

| Parameters ||
|---|---|
| `type` | `int`: type of sensor requested <br /> |
| `wakeUp` | `boolean`: flag to indicate whether the Sensor is a wake-up or non wake-up sensor. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/hardware/Sensor` | the default sensor matching the requested type and wakeUp properties if one exists and the application has the necessary permissions, or null otherwise. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/Sensor#isWakeUpSensor()`

### getDynamicSensorList

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Sensor> getDynamicSensorList (int type)
```

Use this method to get a list of available dynamic sensors of a certain type. Make multiple calls to get sensors of different types or use `https://developer.android.com/reference/android/hardware/Sensor#TYPE_ALL` to get all dynamic sensors.

NOTE: Both wake-up and non wake-up sensors matching the given type are returned. Check `https://developer.android.com/reference/android/hardware/Sensor#isWakeUpSensor()` to know the wake-up properties of the returned `https://developer.android.com/reference/android/hardware/Sensor`.

<br />

<br />

| Parameters ||
|---|---|
| `type` | `int`: of sensors requested <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/hardware/Sensor>` | a list of dynamic sensors matching the requested type. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/Sensor`

### getInclination

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static float getInclination (float[] I)
```

Computes the geomagnetic inclination angle in radians from the inclination matrix **I** returned by `https://developer.android.com/reference/android/hardware/SensorManager#getRotationMatrix(float[],%20float[],%20float[],%20float[])`.

<br />

| Parameters ||
|---|---|
| `I` | `float`: inclination matrix see `https://developer.android.com/reference/android/hardware/SensorManager#getRotationMatrix(float[],%20float[],%20float[],%20float[])`. <br /> |

| Returns ||
|---|---|
| `float` | The geomagnetic inclination angle in radians. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#getRotationMatrix(float[],%20float[],%20float[],%20float[])`
- `https://developer.android.com/reference/android/hardware/SensorManager#getOrientation(float[],%20float[])`
- `https://developer.android.com/reference/android/hardware/GeomagneticField`

### getOrientation

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static float[] getOrientation (float[] R, 
                float[] values)
```

Computes the device's orientation based on the rotation matrix.

When it returns, the array values are as follows:

- values\[0\]: *Azimuth*, angle of rotation about the -z axis. This value represents the angle between the device's y axis and the magnetic north pole. When facing north, this angle is 0, when facing south, this angle is π. Likewise, when facing east, this angle is π/2, and when facing west, this angle is -π/2. The range of values is -π to π.
- values\[1\]: *Pitch*, angle of rotation about the -x axis. This value represents the angle between a plane parallel to the device's screen and a plane parallel to the ground. Assuming that the bottom edge of the device faces the user and that the screen is face-up, tilting the top edge of the device toward the ground creates a positive pitch angle. The range of values is -π/2 to π/2.
- values\[2\]: *Roll*, angle of rotation about the y axis. This value represents the angle between a plane perpendicular to the device's screen and a plane perpendicular to the ground. Assuming that the bottom edge of the device faces the user and that the screen is face-up, tilting the right edge of the device toward the ground creates a positive roll angle. The range of values is -π to π.

Applying these three rotations in the azimuth, pitch, roll order transforms an identity matrix to the rotation matrix passed into this method. Also, note that all three orientation angles are expressed in **radians**.

<br />

| Parameters ||
|---|---|
| `R` | `float`: rotation matrix see `https://developer.android.com/reference/android/hardware/SensorManager#getRotationMatrix(float[],%20float[],%20float[],%20float[])`. <br /> |
| `values` | `float`: an array of 3 floats to hold the result. <br /> |

| Returns ||
|---|---|
| `float[]` | The array values passed as argument. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#getRotationMatrix(float[],%20float[],%20float[],%20float[])`
- `https://developer.android.com/reference/android/hardware/GeomagneticField`

### getQuaternionFromVector

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void getQuaternionFromVector (float[] Q, 
                float[] rv)
```

Helper function to convert a rotation vector to a normalized quaternion. Given a rotation vector (presumably from a ROTATION_VECTOR sensor), returns a normalized quaternion in the array Q. The quaternion is stored as \[w, x, y, z\]

<br />

| Parameters ||
|---|---|
| `Q` | `float`: an array of floats in which to store the computed quaternion <br /> |
| `rv` | `float`: the rotation vector to convert <br /> |

### getRotationMatrix

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static boolean getRotationMatrix (float[] R, 
                float[] I, 
                float[] gravity, 
                float[] geomagnetic)
```

<br />

Computes the inclination matrix **I** as well as the rotation matrix **R** transforming a vector from the device coordinate system to the world's coordinate system which is defined as a direct orthonormal basis, where:

- X is defined as the vector product **Y.Z** (It is tangential to the ground at the device's current location and roughly points East).
- Y is tangential to the ground at the device's current location and points towards the magnetic North Pole.
- Z points towards the sky and is perpendicular to the ground.

<br />

![World coordinate-system diagram.](https://developer.android.com/images/axis_globe.png)

<br />

<br />

*** ** * ** ***

By definition:

\[0 0 g\] = **R** \* **gravity** (g = magnitude of gravity)

\[0 m 0\] = **I** \* **R** \* **geomagnetic** (m = magnitude of geomagnetic field)

**R** is the identity matrix when the device is aligned with the world's coordinate system, that is, when the device's X axis points toward East, the Y axis points to the North Pole and the device is facing the sky.

**I** is a rotation matrix transforming the geomagnetic vector into the same coordinate space as gravity (the world's coordinate space). **I** is a simple rotation around the X axis. The inclination angle in radians can be computed with `https://developer.android.com/reference/android/hardware/SensorManager#getInclination(float[])`.

*** ** * ** ***

Each matrix is returned either as a 3x3 or 4x4 row-major matrix depending on the length of the passed array:

If the array length is 16:

```
   /  M[ 0]   M[ 1]   M[ 2]   M[ 3]  \
   |  M[ 4]   M[ 5]   M[ 6]   M[ 7]  |
   |  M[ 8]   M[ 9]   M[10]   M[11]  |
   \  M[12]   M[13]   M[14]   M[15]  /
```
This matrix is ready to be used by OpenGL ES's `https://developer.android.com/reference/javax/microedition/khronos/opengles/GL10#glLoadMatrixf(float[],%20int)`.

Note that because OpenGL matrices are column-major matrices you must transpose the matrix before using it. However, since the matrix is a rotation matrix, its transpose is also its inverse, conveniently, it is often the inverse of the rotation that is needed for rendering; it can therefore be used with OpenGL ES directly.

Also note that the returned matrices always have this form:

```
   /  M[ 0]   M[ 1]   M[ 2]   0  \
   |  M[ 4]   M[ 5]   M[ 6]   0  |
   |  M[ 8]   M[ 9]   M[10]   0  |
   \      0       0       0   1  /
```

If the array length is 9:

```
   /  M[ 0]   M[ 1]   M[ 2]  \
   |  M[ 3]   M[ 4]   M[ 5]  |
   \  M[ 6]   M[ 7]   M[ 8]  /
```

*** ** * ** ***

The inverse of each matrix can be computed easily by taking its transpose.

The matrices returned by this function are meaningful only when the device is not free-falling and it is not close to the magnetic north. If the device is accelerating, or placed into a strong magnetic field, the returned matrices may be inaccurate.

<br />

| Parameters ||
|---|---|
| `R` | `float`: is an array of 9 floats holding the rotation matrix **R** when this function returns. R can be null. <br /> |
| `I` | `float`: is an array of 9 floats holding the rotation matrix **I** when this function returns. I can be null. <br /> |
| `gravity` | `float`: is an array of 3 floats containing the gravity vector expressed in the device's coordinate. You can simply use the `https://developer.android.com/reference/android/hardware/SensorEvent#values` returned by a `https://developer.android.com/reference/android/hardware/SensorEvent` of a `https://developer.android.com/reference/android/hardware/Sensor` of type `https://developer.android.com/reference/android/hardware/Sensor#TYPE_ACCELEROMETER`. <br /> |
| `geomagnetic` | `float`: is an array of 3 floats containing the geomagnetic vector expressed in the device's coordinate. You can simply use the `https://developer.android.com/reference/android/hardware/SensorEvent#values` returned by a `https://developer.android.com/reference/android/hardware/SensorEvent` of a `https://developer.android.com/reference/android/hardware/Sensor` of type `https://developer.android.com/reference/android/hardware/Sensor#TYPE_MAGNETIC_FIELD`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` on success, `false` on failure (for instance, if the device is in free fall). Free fall is defined as condition when the magnitude of the gravity is less than 1/10 of the nominal value. On failure the output matrices are not modified. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#getInclination(float[])`
- `https://developer.android.com/reference/android/hardware/SensorManager#getOrientation(float[],%20float[])`
- `https://developer.android.com/reference/android/hardware/SensorManager#remapCoordinateSystem(float[],%20int,%20int,%20float[])`

### getRotationMatrixFromVector

Added in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static void getRotationMatrixFromVector (float[] R, 
                float[] rotationVector)
```

Helper function to convert a rotation vector to a rotation matrix. Given a rotation vector (presumably from a ROTATION_VECTOR sensor), returns a 9 or 16 element rotation matrix in the array R. R must have length 9 or 16. If R.length == 9, the following matrix is returned:

```
   /  R[ 0]   R[ 1]   R[ 2]   \
   |  R[ 3]   R[ 4]   R[ 5]   |
   \  R[ 6]   R[ 7]   R[ 8]   /
```
If R.length == 16, the following matrix is returned:

```
   /  R[ 0]   R[ 1]   R[ 2]   0  \
   |  R[ 4]   R[ 5]   R[ 6]   0  |
   |  R[ 8]   R[ 9]   R[10]   0  |
   \  0       0       0       1  /
```

<br />

<br />

| Parameters ||
|---|---|
| `R` | `float`: an array of floats in which to store the rotation matrix <br /> |
| `rotationVector` | `float`: the rotation vector to convert <br /> |

### getSensorList

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Sensor> getSensorList (int type)
```

Use this method to get the list of available sensors of a certain type. Make multiple calls to get sensors of different types or use `https://developer.android.com/reference/android/hardware/Sensor#TYPE_ALL` to get all the sensors. Note that the `https://developer.android.com/reference/android/hardware/Sensor#getName()` is expected to yield a value that is unique across any sensors that return the same value for `https://developer.android.com/reference/android/hardware/Sensor#getType()`.

NOTE: Both wake-up and non wake-up sensors matching the given type are returned. Check `https://developer.android.com/reference/android/hardware/Sensor#isWakeUpSensor()` to know the wake-up properties of the returned `https://developer.android.com/reference/android/hardware/Sensor`.

<br />

<br />

| Parameters ||
|---|---|
| `type` | `int`: of sensors requested <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/hardware/Sensor>` | a list of sensors matching the asked type. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#getDefaultSensor(int)`
- `https://developer.android.com/reference/android/hardware/Sensor`

### getSensors

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSensors ()
```

<br />

**This method was deprecated in API level 15.**   

This method is deprecated, use `https://developer.android.com/reference/android/hardware/SensorManager#getSensorList(int)` instead

<br />

<br />

| Returns ||
|---|---|
| `int` | available sensors. <br /> |

### isDynamicSensorDiscoverySupported

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isDynamicSensorDiscoverySupported ()
```

Tell if dynamic sensor discovery feature is supported by system.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if dynamic sensor discovery is supported, `false` otherwise. <br /> |

### registerDynamicSensorCallback

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void registerDynamicSensorCallback (SensorManager.DynamicSensorCallback callback)
```

Add a `https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback` to receive dynamic sensor connection callbacks. Repeat registration with the already registered callback object will have no additional effect.

<br />

| Parameters ||
|---|---|
| `callback` | `SensorManager.DynamicSensorCallback`: An object that implements the `https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback` interface for receiving callbacks. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | when callback is null. |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#registerDynamicSensorCallback(android.hardware.SensorManager.DynamicSensorCallback,%20android.os.Handler)`

### registerDynamicSensorCallback

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void registerDynamicSensorCallback (SensorManager.DynamicSensorCallback callback, 
                Handler handler)
```

Add a `https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback` to receive dynamic sensor connection callbacks. Repeat registration with the already registered callback object will have no additional effect.

<br />

| Parameters ||
|---|---|
| `callback` | `SensorManager.DynamicSensorCallback`: An object that implements the `https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback` interface for receiving callbacks. <br /> |
| `handler` | `Handler`: The `https://developer.android.com/reference/android/os/Handler` the `https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback` will be delivered to. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | when callback is null. |

### registerListener

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean registerListener (SensorEventListener listener, 
                Sensor sensor, 
                int samplingPeriodUs)
```

Registers a `https://developer.android.com/reference/android/hardware/SensorEventListener` for the given sensor at the given sampling frequency.

The events will be delivered to the provided `SensorEventListener` as soon as they are available. To reduce the power consumption, applications can use `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int,%20int)` instead and specify a positive non-zero maximum reporting latency.

In the case of non-wake-up sensors, the events are only delivered while the Application Processor (AP) is not in suspend mode. See `https://developer.android.com/reference/android/hardware/Sensor#isWakeUpSensor()` for more details. To ensure delivery of events from non-wake-up sensors even when the screen is OFF, the application registering to the sensor must hold a partial wake-lock to keep the AP awake, otherwise some events might be lost while the AP is asleep. Note that although events might be lost while the AP is asleep, the sensor will still consume power if it is not explicitly deactivated by the application. Applications must unregister their `SensorEventListener`s in their activity's `onPause()` method to avoid consuming power while the device is inactive. See `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int,%20int)` for more details on hardware FIFO (queueing) capabilities and when some sensor events might be lost.

In the case of wake-up sensors, each event generated by the sensor will cause the AP to wake-up, ensuring that each event can be delivered. Because of this, registering to a wake-up sensor has very significant power implications. Call `https://developer.android.com/reference/android/hardware/Sensor#isWakeUpSensor()` to check whether a sensor is a wake-up sensor. See `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int,%20int)` for information on how to reduce the power impact of registering to wake-up sensors.

Note: Don't use this method with one-shot trigger sensors such as `https://developer.android.com/reference/android/hardware/Sensor#TYPE_SIGNIFICANT_MOTION`. Use `https://developer.android.com/reference/android/hardware/SensorManager#requestTriggerSensor(android.hardware.TriggerEventListener,%20android.hardware.Sensor)` instead. Use `https://developer.android.com/reference/android/hardware/Sensor#getReportingMode()` to obtain the reporting mode of a given sensor.

<br />

<br />

| Parameters ||
|---|---|
| `listener` | `SensorEventListener`: A `https://developer.android.com/reference/android/hardware/SensorEventListener` object. <br /> |
| `sensor` | `Sensor`: The `https://developer.android.com/reference/android/hardware/Sensor` to register to. <br /> |
| `samplingPeriodUs` | `int`: The rate `https://developer.android.com/reference/android/hardware/SensorEvent` are delivered at. This is only a hint to the system. Events may be received faster or slower than the specified rate. Usually events are received faster. The value must be one of `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_NORMAL`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_UI`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_GAME`, or `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_FASTEST` or, the desired delay between events in microseconds. Specifying the delay in microseconds only works from Android 2.3 (API level 9) onwards. For earlier releases, you must use one of the `SENSOR_DELAY_*` constants. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the sensor is supported and successfully enabled. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int,%20android.os.Handler)`
- `https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener)`
- `https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener,%20android.hardware.Sensor)`

### registerListener

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean registerListener (SensorEventListener listener, 
                Sensor sensor, 
                int samplingPeriodUs, 
                int maxReportLatencyUs)
```

Registers a `https://developer.android.com/reference/android/hardware/SensorEventListener` for the given sensor at the given sampling frequency and the given maximum reporting latency.

This function is similar to `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)` but it allows events to stay temporarily in the hardware FIFO (queue) before being delivered. The events can be stored in the hardware FIFO up to `maxReportLatencyUs` microseconds. Once one of the events in the FIFO needs to be reported, all of the events in the FIFO are reported sequentially. This means that some events will be reported before the maximum reporting latency has elapsed.

When `maxReportLatencyUs` is 0, the call is equivalent to a call to `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)`, as it requires the events to be delivered as soon as possible.

When `sensor.maxFifoEventCount()` is 0, the sensor does not use a FIFO, so the call will also be equivalent to `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)`.

Setting `maxReportLatencyUs` to a positive value allows to reduce the number of interrupts the AP (Application Processor) receives, hence reducing power consumption, as the AP can switch to a lower power state while the sensor is capturing the data. This is especially important when registering to wake-up sensors, for which each interrupt causes the AP to wake up if it was in suspend mode. See `https://developer.android.com/reference/android/hardware/Sensor#isWakeUpSensor()` for more information on wake-up sensors.

<br />

Note: Don't use this method with one-shot trigger sensors such as `https://developer.android.com/reference/android/hardware/Sensor#TYPE_SIGNIFICANT_MOTION`. Use `https://developer.android.com/reference/android/hardware/SensorManager#requestTriggerSensor(android.hardware.TriggerEventListener,%20android.hardware.Sensor)` instead.

<br />

<br />

<br />

| Parameters ||
|---|---|
| `listener` | `SensorEventListener`: A `https://developer.android.com/reference/android/hardware/SensorEventListener` object that will receive the sensor events. If the application is interested in receiving flush complete notifications, it should register with `https://developer.android.com/reference/android/hardware/SensorEventListener` instead. <br /> |
| `sensor` | `Sensor`: The `https://developer.android.com/reference/android/hardware/Sensor` to register to. <br /> |
| `samplingPeriodUs` | `int`: The desired delay between two consecutive events in microseconds. This is only a hint to the system. Events may be received faster or slower than the specified rate. Usually events are received faster. Can be one of `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_NORMAL`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_UI`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_GAME`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_FASTEST` or the delay in microseconds. <br /> |
| `maxReportLatencyUs` | `int`: Maximum time in microseconds that events can be delayed before being reported to the application. A large value allows reducing the power consumption associated with the sensor. If maxReportLatencyUs is set to zero, events are delivered as soon as they are available, which is equivalent to calling `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the sensor is supported and successfully enabled. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)`
- `https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener)`
- `https://developer.android.com/reference/android/hardware/SensorManager#flush(android.hardware.SensorEventListener)`

### registerListener

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean registerListener (SensorEventListener listener, 
                Sensor sensor, 
                int samplingPeriodUs, 
                Handler handler)
```

Registers a `https://developer.android.com/reference/android/hardware/SensorEventListener` for the given sensor. Events are delivered in continuous mode as soon as they are available. To reduce the power consumption, applications can use `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int,%20int)` instead and specify a positive non-zero maximum reporting latency.

<br />

Note: Don't use this method with a one shot trigger sensor such as `https://developer.android.com/reference/android/hardware/Sensor#TYPE_SIGNIFICANT_MOTION`. Use `https://developer.android.com/reference/android/hardware/SensorManager#requestTriggerSensor(android.hardware.TriggerEventListener,%20android.hardware.Sensor)` instead.

<br />

<br />

<br />

| Parameters ||
|---|---|
| `listener` | `SensorEventListener`: A `https://developer.android.com/reference/android/hardware/SensorEventListener` object. <br /> |
| `sensor` | `Sensor`: The `https://developer.android.com/reference/android/hardware/Sensor` to register to. <br /> |
| `samplingPeriodUs` | `int`: The rate `https://developer.android.com/reference/android/hardware/SensorEvent` are delivered at. This is only a hint to the system. Events may be received faster or slower than the specified rate. Usually events are received faster. The value must be one of `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_NORMAL`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_UI`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_GAME`, or `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_FASTEST` or, the desired delay between events in microseconds. Specifying the delay in microseconds only works from Android 2.3 (API level 9) onwards. For earlier releases, you must use one of the `SENSOR_DELAY_*` constants. <br /> |
| `handler` | `Handler`: The `https://developer.android.com/reference/android/os/Handler` the `https://developer.android.com/reference/android/hardware/SensorEvent` will be delivered to. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the sensor is supported and successfully enabled. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)`
- `https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener)`
- `https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener,%20android.hardware.Sensor)`

### registerListener

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean registerListener (SensorListener listener, 
                int sensors)
```

<br />

**This method was deprecated in API level 15.**   

This method is deprecated, use `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)` instead.

Registers a listener for given sensors.

<br />

| Parameters ||
|---|---|
| `listener` | `SensorListener`: sensor listener object <br /> |
| `sensors` | `int`: a bit masks of the sensors to register to <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the sensor is supported and successfully enabled <br /> |

### registerListener

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean registerListener (SensorListener listener, 
                int sensors, 
                int rate)
```

<br />

**This method was deprecated in API level 15.**   

This method is deprecated, use `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)` instead.

Registers a SensorListener for given sensors.

<br />

| Parameters ||
|---|---|
| `listener` | `SensorListener`: sensor listener object <br /> |
| `sensors` | `int`: a bit masks of the sensors to register to <br /> |
| `rate` | `int`: 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. The value must be one of `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_NORMAL`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_UI`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_GAME`, or `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_FASTEST`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the sensor is supported and successfully enabled <br /> |

### registerListener

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean registerListener (SensorEventListener listener, 
                Sensor sensor, 
                int samplingPeriodUs, 
                int maxReportLatencyUs, 
                Handler handler)
```

Registers a `https://developer.android.com/reference/android/hardware/SensorEventListener` for the given sensor at the given sampling frequency and the given maximum reporting latency.

<br />

| Parameters ||
|---|---|
| `listener` | `SensorEventListener`: A `https://developer.android.com/reference/android/hardware/SensorEventListener` object that will receive the sensor events. If the application is interested in receiving flush complete notifications, it should register with `https://developer.android.com/reference/android/hardware/SensorEventListener` instead. <br /> |
| `sensor` | `Sensor`: The `https://developer.android.com/reference/android/hardware/Sensor` to register to. <br /> |
| `samplingPeriodUs` | `int`: The desired delay between two consecutive events in microseconds. This is only a hint to the system. Events may be received faster or slower than the specified rate. Usually events are received faster. Can be one of `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_NORMAL`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_UI`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_GAME`, `https://developer.android.com/reference/android/hardware/SensorManager#SENSOR_DELAY_FASTEST` or the delay in microseconds. <br /> |
| `maxReportLatencyUs` | `int`: Maximum time in microseconds that events can be delayed before being reported to the application. A large value allows reducing the power consumption associated with the sensor. If maxReportLatencyUs is set to zero, events are delivered as soon as they are available, which is equivalent to calling `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)`. <br /> |
| `handler` | `Handler`: The `https://developer.android.com/reference/android/os/Handler` the `https://developer.android.com/reference/android/hardware/SensorEvent` will be delivered to. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the sensor is supported and successfully enabled. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int,%20int)`

### remapCoordinateSystem

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static boolean remapCoordinateSystem (float[] inR, 
                int X, 
                int Y, 
                float[] outR)
```

<br />

Rotates the supplied rotation matrix so it is expressed in a different coordinate system. This is typically used when an application needs to compute the three orientation angles of the device (see `https://developer.android.com/reference/android/hardware/SensorManager#getOrientation(float[],%20float[])`) in a different coordinate system.

When the rotation matrix is used for drawing (for instance with OpenGL ES), it usually **doesn't need** to be transformed by this function, unless the screen is physically rotated, in which case you can use `https://developer.android.com/reference/android/view/Display#getRotation()` to retrieve the current rotation of the screen. Note that because the user is generally free to rotate their screen, you often should consider the rotation in deciding the parameters to use here.

Examples:

<br />

- Using the camera (Y axis along the camera's axis) for an augmented reality application where the rotation angles are needed:
`remapCoordinateSystem(inR, AXIS_X, AXIS_Z, outR);`
- Using the device as a mechanical compass when rotation is `https://developer.android.com/reference/android/view/Surface#ROTATION_90`:
`remapCoordinateSystem(inR, AXIS_Y, AXIS_MINUS_X, outR);` Beware of the above example. This call is needed only to account for a rotation from its natural orientation when calculating the rotation angles (see `https://developer.android.com/reference/android/hardware/SensorManager#getOrientation(float[],%20float[])`). If the rotation matrix is also used for rendering, it may not need to be transformed, for instance if your `https://developer.android.com/reference/android/app/Activity` is running in landscape mode.

Since the resulting coordinate system is orthonormal, only two axes need to be specified.

<br />

| Parameters ||
|---|---|
| `inR` | `float`: the rotation matrix to be transformed. Usually it is the matrix returned by `https://developer.android.com/reference/android/hardware/SensorManager#getRotationMatrix(float[],%20float[],%20float[],%20float[])`. <br /> |
| `X` | `int`: defines the axis of the new coordinate system that coincide with the X axis of the original coordinate system. <br /> |
| `Y` | `int`: defines the axis of the new coordinate system that coincide with the Y axis of the original coordinate system. <br /> |
| `outR` | `float`: the transformed rotation matrix. inR and outR should not be the same array. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` on success. `false` if the input parameters are incorrect, for instance if X and Y define the same axis. Or if inR and outR don't have the same length. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#getRotationMatrix(float[],%20float[],%20float[],%20float[])`

### requestTriggerSensor

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean requestTriggerSensor (TriggerEventListener listener, 
                Sensor sensor)
```

Requests receiving trigger events for a trigger sensor.

When the sensor detects a trigger event condition, such as significant motion in the case of the `https://developer.android.com/reference/android/hardware/Sensor#TYPE_SIGNIFICANT_MOTION`, the provided trigger listener will be invoked once and then its request to receive trigger events will be canceled. To continue receiving trigger events, the application must request to receive trigger events again.

<br />

<br />

| Parameters ||
|---|---|
| `listener` | `TriggerEventListener`: The listener on which the `https://developer.android.com/reference/android/hardware/TriggerEventListener#onTrigger(android.hardware.TriggerEvent)` will be delivered. <br /> |
| `sensor` | `Sensor`: The sensor to be enabled. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the sensor was successfully enabled. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | when sensor is null or not a trigger sensor. |

### unregisterDynamicSensorCallback

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterDynamicSensorCallback (SensorManager.DynamicSensorCallback callback)
```

Remove a `https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback` to stop sending dynamic sensor connection events to that callback.

<br />

| Parameters ||
|---|---|
| `callback` | `SensorManager.DynamicSensorCallback`: An object that implements the `https://developer.android.com/reference/android/hardware/SensorManager.DynamicSensorCallback` interface for receiving callbacks. <br /> |

### unregisterListener

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterListener (SensorEventListener listener)
```

Unregisters a listener for all sensors.

<br />

| Parameters ||
|---|---|
| `listener` | `SensorEventListener`: a SensorListener object <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener,%20android.hardware.Sensor)`
- `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)`

### unregisterListener

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterListener (SensorEventListener listener, 
                Sensor sensor)
```

Unregisters a listener for the sensors with which it is registered.

Note: Don't use this method with a one shot trigger sensor such as `https://developer.android.com/reference/android/hardware/Sensor#TYPE_SIGNIFICANT_MOTION`. Use `https://developer.android.com/reference/android/hardware/SensorManager#cancelTriggerSensor(android.hardware.TriggerEventListener,%20android.hardware.Sensor)` instead.

<br />

<br />

| Parameters ||
|---|---|
| `listener` | `SensorEventListener`: a SensorEventListener object <br /> |
| `sensor` | `Sensor`: the sensor to unregister from <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener)`
- `https://developer.android.com/reference/android/hardware/SensorManager#registerListener(android.hardware.SensorEventListener,%20android.hardware.Sensor,%20int)`

### unregisterListener

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterListener (SensorListener listener)
```

<br />

**This method was deprecated in API level 15.**   

This method is deprecated, use `https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener)` instead.

Unregisters a listener for all sensors.

<br />

| Parameters ||
|---|---|
| `listener` | `SensorListener`: a SensorListener object <br /> |

### unregisterListener

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterListener (SensorListener listener, 
                int sensors)
```

<br />

**This method was deprecated in API level 15.**   

This method is deprecated, use `https://developer.android.com/reference/android/hardware/SensorManager#unregisterListener(android.hardware.SensorEventListener,%20android.hardware.Sensor)` instead.

Unregisters a listener for the sensors with which it is registered.

<br />

| Parameters ||
|---|---|
| `listener` | `SensorListener`: a SensorListener object <br /> |
| `sensors` | `int`: a bit masks of the sensors to unregister from <br /> |