Andrdoid Sensors Overview (探測器概述)一

Most Android-powered devices have built-in sensors that measure motion, orientation, and 

大部分Android設備有內置的探測器,用於探測運動,方位,及各種環境條件。

various environmental conditions. These sensors are capable of providing raw data with high

如果你想要探測三位設備運動或定位,或者想要探測設備附近環境變化,這些探測器所能夠提供的高精準的探測數值將會非常有用。

precision and accuracy, and are useful if you want to monitor three-dimensional device movement or positioning, or you want to monitor changes in the ambient environment near a device. For example, a game might track readings from a device's gravity sensor to infer

例如,一款遊戲可能需要持續讀取設備的重力感應數值來解析複雜的用戶姿勢和運動,比如傾斜,晃動,旋轉,或搖擺。類似地,一個天氣應用會使用溫度探測器和溼度探測器來計算並報告結露點,又或者一款旅遊應用使用地磁場探測器和加速器來報告指南針方位。

complex user gestures and motions, such as tilt, shake, rotation, or swing. Likewise, a weather application might use a device's temperature sensor and humidity sensor to calculate and report the dewpoint, or a travel application might use the geomagnetic field sensor and accelerometer to report a compass bearing.

The Android platform supports three broad categories of sensors:

Android 平臺支持三大類傳感器:

  • Motion sensors

  • 運動傳感器

    These sensors measure acceleration forces and rotational forces along three axes. This  category includes accelerometers, gravity sensors, gyroscopes, and rotational vector sensors.

    這類探測器通過三個軸測量加速力量和旋轉力量。包括加速計,重力探測器,陀螺儀,和穿轉矢量傳感器。

  • Environmental sensors

  • 環境傳感器

    These sensors measure various environmental parameters, such as ambient air temperature  and pressure, illumination, and humidity. This category includes barometers, photometers, and thermometers.

    這類探測器測量各種環境參數,例如環境的氣溫與氣壓,光照與溼度。包括氣壓計,光度計,和溫度計。

  • Position sensors

  • 位置探測器

    These sensors measure the physical position of a device. This category includes orientation sensors and magnetometers.

    這類探測器測量設備的物理位置。包括定位傳感器和磁力計。

You can access sensors available on the device and acquire raw sensor data by using the Android sensor framework. The sensor framework provides several classes and interfaces that help you perform a wide variety of sensor-related tasks. For example, you can use the sensor framework to do the following:

通過使用Android sensor framework,你可以訪問到設備上可用的探測器並獲取原始的探測數據。這個探測框架提供了幾個類和接口幫助你執行一系列探測器相關的任務。例如,你可以使用 sensor framework 來做以下事情:

  • Determine which sensors are available on a device.

  • 確定設備上那些探測器可用。

  • Determine an individual sensor's capabilities, such as its maximum range, manufacturer, power requirements, and resolution.

  • 確定某個探測器的功能,例如最大探測距離,製造商,供電要求,和分辨率。

  • Acquire raw sensor data and define the minimum rate at which you acquire sensor data.

  • 獲取原始探測數據並定義獲取數據的最小速度。

  • Register and unregister sensor event listeners that monitor sensor changes.

  • 註冊和註銷監測探測器變化的sensor event listners。

This topic provides an overview of the sensors that are available on the Android platform. It also provides an introduction to the sensor framework.

這節提供傳感器的概述,並介紹sensor framework。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章