Time for action – getting the sensor values and updating the user interface

Now, let's deal with the most important aspect of sensors, that is, playing with the sensor values. We have created a common activity and screen that can fit a vast number of values for all sensor types. Sensors can have varied values such as temperature or pressure; a light and proximity sensor may have only one value, while sensors such as magnetometer, accelerometer, gyroscope, linear acceleration, and gravity have the three values in the x, y, and z axes. There are other sensors that can have more than three values, for example, rotational vector, geomagnetic rotational vector, game rotational vector, and un-calibrated gyroscope. All the sensor values are passed in ...

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.