溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Andrdoid Sensors Overview (探測器概述)一

發(fā)布時間:2020-06-21 09:34:08 來源:網(wǎng)絡(luò) 閱讀:346 作者:weijianzhenli 欄目:移動開發(fā)

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

大部分Android設(shè)備有內(nèi)置的探測器,用于探測運動,方位,及各種環(huán)境條件。

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

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

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

例如,一款游戲可能需要持續(xù)讀取設(shè)備的重力感應(yīng)數(shù)值來解析復(fù)雜的用戶姿勢和運動,比如傾斜,晃動,旋轉(zhuǎn),或搖擺。類似地,一個天氣應(yīng)用會使用溫度探測器和濕度探測器來計算并報告結(jié)露點,又或者一款旅游應(yīng)用使用地磁場探測器和加速器來報告指南針方位。

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.

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

  • Environmental sensors

  • 環(huán)境傳感器

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

    這類探測器測量各種環(huán)境參數(shù),例如環(huán)境的氣溫與氣壓,光照與濕度。包括氣壓計,光度計,和溫度計。

  • Position sensors

  • 位置探測器

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

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

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,你可以訪問到設(shè)備上可用的探測器并獲取原始的探測數(shù)據(jù)。這個探測框架提供了幾個類和接口幫助你執(zhí)行一系列探測器相關(guān)的任務(wù)。例如,你可以使用 sensor framework 來做以下事情:

  • Determine which sensors are available on a device.

  • 確定設(shè)備上那些探測器可用。

  • 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.

  • 獲取原始探測數(shù)據(jù)并定義獲取數(shù)據(jù)的最小速度。

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

  • 注冊和注銷監(jiān)測探測器變化的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.

這節(jié)提供傳感器的概述,并介紹sensor framework。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI