Types of sensors in Android: Sensor Type direction, acceleration table, light, magnetic field, closeness, temperature, etc. The fastest sampling rate, game, common, and user interface. When an application requests a specific sampling rate, it only prompts or recommends the sensor subsystem. The specified sampling rate is not guaranteed. High Accuracy, Low, Medium, and unreliable. The SensorListener interface is the center of the sensor application. It includes two required methods: The onSensorChanged (int sensor, float values []) method is called when the sensor value is changed. This method is only called by the sensor monitored by this application (for more information, see the following ). Parameters of this method include: an integer indicating the changed sensor; an array of floating-point values indicating the sensor data itself. Some sensors only provide one data value, while others provide three floating point values. The direction sensor and the acceleration table sensor both provide three data values. When the sensor's precision changes, the onAccuracyChanged (int sensor, int accuracy) method is called. Parameters include two integers: one representing the sensor and the other representing the new accurate value of the sensor. To interact with a sensor, the application must register to listen for activities related to one or more sensors. Register and use the registerListener method of the SensorManager class. The sample code in this article demonstrates how to register and deregister the SensorListener. The following are several sensors supported by Android: Sensor. TYPE_ACCELEROMETER: Accelerometer Sensor. TYPE_GYROSCOPE: gyroscope Sensor. TYPE_LIGHT: brightness Sensor. TYPE_MAGNETIC_FIELD: Geomagnetic Sensor. TYPE_ORIENTATION: Orientation Sensor. TYPE_PRESSURE: pressure Sensor. TYPE_PROXIMITY: short-range Sensor. TYPE_TEMPERATURE: Temperature Sensor previous article: Android Baidu map basic implementation (TAG + GPS)