Class of android.hardware · SensorManager.java · Android's reference
public class SensorManager
The device's sensors: none (Off in docs/platforms/android-apps/interfaces.md), as a desktop has none, so a registration fails and no event comes. The rotation helpers compute what Android's do, from their documented definitions.
public static final float GRAVITY_EARTH = 9.80665f sourcepublic static final float STANDARD_GRAVITY = 9.80665f sourcepublic static final int SENSOR_DELAY_FASTEST = 0 sourcepublic static final int SENSOR_DELAY_GAME = 1 sourcepublic static final int SENSOR_DELAY_UI = 2 sourcepublic static final int SENSOR_DELAY_NORMAL = 3 sourcepublic static final int SENSOR_STATUS_NO_CONTACT = -1 sourcepublic static final int SENSOR_STATUS_UNRELIABLE = 0 sourcepublic static final int SENSOR_STATUS_ACCURACY_LOW = 1 sourcepublic static final int SENSOR_STATUS_ACCURACY_MEDIUM = 2 sourcepublic static final int SENSOR_STATUS_ACCURACY_HIGH = 3 sourcepublic static final int AXIS_X = 1 sourcepublic static final int AXIS_Y = 2 sourcepublic static final int AXIS_Z = 3 sourcepublic static final int AXIS_MINUS_X = AXIS_X | 0x80 sourcepublic static final int AXIS_MINUS_Y = AXIS_Y | 0x80 sourcepublic static final int AXIS_MINUS_Z = AXIS_Z | 0x80 sourcepublic SensorManager() empty body sourcepublic List<Sensor> getSensorList(int type) sourcepublic Sensor getDefaultSensor(int type) sourcepublic Sensor getDefaultSensor(int type, boolean wakeUp) sourcepublic boolean registerListener(SensorEventListener listener, Sensor sensor, int samplingPeriodUs) sourcepublic boolean registerListener(SensorEventListener listener, Sensor sensor, int samplingPeriodUs, int maxReportLatencyUs) sourcepublic boolean registerListener(SensorEventListener listener, Sensor sensor, int samplingPeriodUs, Handler handler) sourcepublic boolean registerListener(SensorEventListener listener, Sensor sensor, int samplingPeriodUs, int maxReportLatencyUs, Handler handler) sourcepublic void unregisterListener(SensorEventListener listener) empty body sourcepublic void unregisterListener(SensorEventListener listener, Sensor sensor) empty body sourcepublic static boolean getRotationMatrix(float[] R, float[] I, float[] gravity, float[] geomagnetic) sourceThe rotation from the device's frame to the world's (east, north, up) by the gravity and the geomagnetic field, row major, 3x3 or 4x4; the inclination matrix too when I is given. False in free fall or near the poles.
public static float[] getOrientation(float[] R, float[] values) sourceazimuth, pitch and roll (radians) of a rotation matrix (3x3 or 4x4)
public static void getRotationMatrixFromVector(float[] R, float[] rotationVector) sourcethe rotation matrix of a rotation vector (the x, y, z of a unit quaternion, its w given or derived)
Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.