- Android Sensor Programming By Example
- Varun Nagpal
- 276字
- 2021-07-16 11:08:08
Motion, position, and environmental sensors
The Android platform supports mainly three broad categories of sensors: the motion, position, and environment-based sensors. This categorization is done based on the type of physical quantity detected and measured by the sensors.
Motion sensors
Motion sensors are responsible for measuring any kind of force that could potentially create motion in the x, y, and z axes of the phone. The motion could be either a linear or angular movement in any direction. This category includes accelerometers, gravity, gyroscope, and rotational vector sensors. Most of these sensors will have values in the x, y, and z axes, and the rotational vector will especially have extra value in the fourth axis, which is the scalar component of the rotation vector.
The following table summarizes the motion sensor usage, types, and power consumption:

Position sensors
Position sensors are used to measure the physical position of the phone in the world's frame of reference. For example, you can use the geomagnetic field sensor in combination with the accelerometer to determine a device's position relative to the magnetic North Pole. You can use the orientation sensor to determine the device's position in your application's frame of reference. Position sensors also support values in the x,y, and z axes.
The following table summarizes the position sensor's usage, types, and power consumption:

Environmental sensors
Environment sensors are responsible for measuring environmental properties, such as temperature, relative humidity, light, and air pressure near the phone. Unlike motion and position sensors, which give sensor values multi-dimensional arrays, the environment sensors report single sensor values.
The following table summarizes the environment sensor's usage, types, and power consumption:

- Android Native Development Kit Cookbook
- Highcharts Cookbook
- H5頁面設計:Mugeda版(微課版)
- 前端HTML+CSS修煉之道(視頻同步+直播)
- Java Web從入門到精通(第3版)
- 微信小程序開發實戰:設計·運營·變現(圖解案例版)
- Android移動應用開發項目教程
- Hands-On Robotics Programming with C++
- Python Machine Learning Cookbook
- SQL Server 2014 Development Essentials
- Java Web入門很輕松(微課超值版)
- Python實戰指南:手把手教你掌握300個精彩案例
- Django 3 Web Development Cookbook
- Django 2.0 入門與實踐
- MATLAB語言及編程實踐:生物數學模型應用