O'Reilly logo

Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android by Michael Eierman, Jakob Iversen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sensors

Android devices may have any number of sensors. Two of these, the network and GPS sensors, were discussed in the previous chapter. However, other sensors may also be used in apps. In all, the Android platform supports about 12 sensors. However, there is no requirement that a manufacturer of an Android device include all of them. For this reason, it is good practice to always check for the presence of a sensor before attempting to use it. Sensors supported range from sensors that measure the devices’ ambient environment, including temperature, relative humidity, atmospheric pressure, magnetic field, and light level, to sensors that detect how the device is moving or rotating.

The Sensor class represents all types of sensors. Sensors are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required