* Most Android-powered devices have built-in sensors that measure motion, orientation, and various environmental conditions.
* A game might track readings from a device's gravity sensor to infer complex user gestures and motions, such as tilt, shake, rotation, or swing. Likewise, a weather application might use a device's temperature sensor and humidity sensor to calculate and report the dewpoint, or a travel application might use the geomagnetic field sensor and accelerometer to report a compass bearing.
* The Android sensor framework lets you access many types of sensors.
* Few Android-powered devices have every type of sensor. For example, most handset devices and tablets have an accelerometer and a magnetometer, but fewer devices have barometers or thermometers. Also, a device can have more than one sensor of a given type.
* The Android platform supports three broad categories of sensors:
- Motion sensors - accelerometers, gravity sensors, gyroscopes, and rotational vector sensors.- Environmental sensors - ambient light, pressure, humidity, temparature
- Position sensors - orientation sensors and magnetometers.
Sensor | Type | Description | Common Uses |
---|---|---|---|
ACCELEROMETER | Hardware | Measures the acceleration force in m/s2 that is applied to a device on all three physical axes (x, y, and z), including the force of gravity. | Motion detection (shake, tilt, etc.). |
AMBIENT TEMPERATURE | Hardware | Measures the ambient room temperature in degrees Celsius (°C). | Monitoring air temperatures. |
GRAVITY | Software or Hardware | Measures the force of gravity in m/s2 that is applied to a device on all three physical axes (x, y, z). | Motion detection (shake, tilt, etc.). |
GYROSCOPE | Hardware | Measures a device's rate of rotation in rad/s around each of the three physical axes (x, y, and z). | Rotation detection (spin, turn, etc.). |
LIGHT | Hardware | Measures the ambient light level (illumination) in lx. | Controlling screen brightness. |
LINEAR ACCELERATION | Software or Hardware | Measures the acceleration force in m/s2 that is applied to a device on all three physical axes (x, y, and z), excluding the force of gravity. | Monitoring acceleration along a single axis. |
MAGNETIC FIELD | Hardware | Measures the ambient geomagnetic field for all three physical axes (x, y, z) in μT. | Creating a compass. |
ORIENTATION | Software | Measures degrees of rotation that a device makes around all three physical axes (x, y, z). The orientation sensor was deprecated in Android 2.2. As of API level 3 you can obtain the inclination matrix and rotation matrix for a device by using the gravity sensor and the geomagnetic field sensor | Determining device position. |
PRESSURE | Hardware | Measures the ambient air pressure in hPa or mbar. | Monitoring air pressure changes. |
PROXIMITY | Hardware | Measures the proximity of an object in cm relative to the view screen of a device. This sensor is typically used to determine whether a handset is being held up to a person's ear. A proximity sensor often emits an electromagnetic field or a beam of electromagnetic radiation (infrared, for instance), and looks for changes in the field or return signal. | Phone position during a call. |
RELATIVE HUMIDITY | Hardware | Measures the relative ambient humidity in percent (%). | Monitoring dewpoint, absolute, and relative humidity. |
ROTATION VECTOR | Software or Hardware | Measures the orientation of a device by providing the three elements of the device's rotation vector. Game Rotation Vector Sensor does not use the geomagnetic field. Geomagnetic Rotation Vector Sensor uses a magnetometer instead of a gyroscope | Motion detection and rotation detection. |
TEMPERATURE | Hardware | Measures the temperature of the device in degrees Celsius (°C). This sensor implementation varies across devices and this sensor was replaced with the AMBIENT TEMPERATURE sensor in API Level 14 | Monitoring temperatures. |
Sensors not explicitly covered by Android documentation -
* Hall effect sensors are used for proximity switching, positioning, speed detection, and current sensing applications
* Fingerprint Sensor
* Infrared Sensor
Related: Sensors supported by Windows Phone 10
No comments:
Post a Comment