Android Sensors HAL icon

Android sensors give applications access to a mobile device's underlying physical sensors. They are data-providing virtual devices defined by sensors.h, the sensor Hardware Abstraction Layer (HAL).

What are Android sensors?

Android sensors are virtual devices that provide data coming from a set of physical sensors: accelerometers, gyroscopes, magnetometers, barometer, humidity, pressure, light, proximity and heart rate sensors.

Not included in the list of physical devices providing data are camera, fingerprint sensor, microphone, and touch screen. These devices have their own reporting mechanism; the separation is arbitrary, but in general, Android sensors provide lower bandwidth data. For example, “100hz x 3 channels” for an accelerometer versus “25hz x 8 MP x 3 channels” for a camera or “44kHz x 1 channel” for a microphone.

Android does not define how the different physical sensors are connected to the system on chip (SoC).

Each Android sensor has a “type” representing how the sensor behaves and what data it provides.

Android sensors provide data as a series of sensor events.

Each event contains:

The interpretation of the reported data depends on the sensor type. See the sensor type definitions for details on what data is reported for each sensor type.

Existing documentation

Targeted at developers

Targeted at manufacturers