Understanding position-based sensors

The position sensor lets your app determine the position of a device. There are two major sensors in this category: the geomagnetic field sensor and the orientation sensor. The proximity sensor, which measures the proximity of any object to the phone, also comes under this category. The proximity sensor has already been discussed in the previous chapter in detail.

The magnetometer sensor

The magnetometer sensor measures the changes in the earth's magnetic field. It provides the raw magnetic field strength in units of micro tesla (μT). The magnetometer sensor is based on a miniature Hall effect sensor, which detects the earth's magnetic field along the three perpendicular xy, and z axes. The Hall effect sensor ...

Get Android Sensor Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.