Example usage for Java android.hardware SensorManager fields, constructors, methods, implement or subclass
The text is from its open source code.
int | SENSOR_ACCELEROMETER A constant describing an accelerometer. |
int | DATA_X Index of the X value in the array returned by android.hardware.SensorListener#onSensorChanged |
int | DATA_Y Index of the Y value in the array returned by android.hardware.SensorListener#onSensorChanged |
int | DATA_Z Index of the Z value in the array returned by android.hardware.SensorListener#onSensorChanged |
float | GRAVITY_EARTH Earth's gravity in SI units (m/s^2) |
float | MAGNETIC_FIELD_EARTH_MAX Maximum magnetic field on Earth's surface |
float | PRESSURE_STANDARD_ATMOSPHERE Standard atmosphere, or average sea-level pressure in hPa (millibar) |
int | SENSOR_DELAY_FASTEST get sensor data as fast as possible |
int | SENSOR_DELAY_GAME rate suitable for games |
int | SENSOR_DELAY_UI rate suitable for the user interface |
int | SENSOR_DELAY_NORMAL rate (default) suitable for screen orientation changes |
int | SENSOR_STATUS_UNRELIABLE The values returned by this sensor cannot be trusted, calibration is needed or the environment doesn't allow readings |
int | SENSOR_STATUS_ACCURACY_LOW This sensor is reporting data with low accuracy, calibration with the environment is needed |
int | SENSOR_STATUS_ACCURACY_MEDIUM This sensor is reporting data with an average level of accuracy, calibration with the environment may improve the readings |
int | SENSOR_STATUS_ACCURACY_HIGH This sensor is reporting data with maximum accuracy |
int | AXIS_X see #remapCoordinateSystem |
int | AXIS_Y see #remapCoordinateSystem |
int | AXIS_Z see #remapCoordinateSystem |
int | AXIS_MINUS_X see #remapCoordinateSystem |
int | AXIS_MINUS_Y see #remapCoordinateSystem |
int | AXIS_MINUS_Z see #remapCoordinateSystem |
float | getAltitude(float p0, float p) Computes the Altitude in meters from the atmospheric pressure and the pressure at sea level. |
Sensor | getDefaultSensor(int type) Use this method to get the default sensor for a given type. |
float[] | getOrientation(float[] R, float[] values) Computes the device's orientation based on the rotation matrix. |
void | getQuaternionFromVector(float[] Q, float[] rv) Helper function to convert a rotation vector to a normalized quaternion. |
boolean | getRotationMatrix(float[] R, float[] I, float[] gravity, float[] geomagnetic) 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:
|
void | getRotationMatrixFromVector(float[] R, float[] rotationVector) Helper function to convert a rotation vector to a rotation matrix. |
List | getSensorList(int type) Use this method to get the list of available sensors of a certain type. |
boolean | registerListener(SensorListener listener, int sensors, int rate) Registers a SensorListener for given sensors. |
boolean | registerListener(SensorEventListener listener, Sensor sensor, int samplingPeriodUs) Registers a android.hardware.SensorEventListener SensorEventListener for the given sensor at the given sampling frequency. |
boolean | registerListener(SensorEventListener listener, Sensor sensor, int samplingPeriodUs, int maxReportLatencyUs) Registers a android.hardware.SensorEventListener SensorEventListener for the given sensor at the given sampling frequency and the given maximum reporting latency. |
boolean | registerListener(SensorEventListener listener, Sensor sensor, int samplingPeriodUs, Handler handler) Registers a android.hardware.SensorEventListener SensorEventListener for the given sensor. |
boolean | remapCoordinateSystem(float[] inR, int X, int Y, float[] outR) Rotates the supplied rotation matrix so it is expressed in a different coordinate system. |
void | unregisterListener(SensorListener listener) Unregisters a listener for all sensors. |
void | unregisterListener(SensorEventListener listener) Unregisters a listener for all sensors. |
void | unregisterListener(SensorListener listener, int sensors) Unregisters a listener for the sensors with which it is registered. |
void | unregisterListener(SensorEventListener listener, Sensor sensor) Unregisters a listener for the sensors with which it is registered. |