【移動應(yīng)用開發(fā)技術(shù)】Andrdoid Sensors Overview (探測器概述)一_第1頁
【移動應(yīng)用開發(fā)技術(shù)】Andrdoid Sensors Overview (探測器概述)一_第2頁
【移動應(yīng)用開發(fā)技術(shù)】Andrdoid Sensors Overview (探測器概述)一_第3頁
全文預覽已結(jié)束

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

【移動應(yīng)用開發(fā)技術(shù)】AndrdoidSensorsOverview(探測器概述)一

MostAndroid-powereddeviceshavebuilt-insensorsthatmeasuremotion,orientation,

and

大部分Android設(shè)備有內(nèi)置的探測器,用于探測運動,方位,及各種環(huán)境條件。variousenvironmentalconditions.Thesesensorsarecapableofprovidingrawdatawithhigh如果你想要探測三位設(shè)備運動或定位,或者想要探測設(shè)備附近環(huán)境變化,這些探測器所能夠提供的高精準的探測數(shù)值將會非常有用。precisionandaccuracy,andareusefulifyouwanttomonitorthree-dimensionaldevicemovementor

positioning,oryouwanttomonitorchangesintheambientenvironmentnearadevice.Forexample,a

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

andmotions,suchastilt,shake,rotation,orswing.Likewise,aweatherapplicationmightusea

device'stemperaturesensorandhumiditysensortocalculateandreportthedewpoint,oratravel

applicationmightusethegeomagneticfieldsensorandaccelerometertoreportacompass

bearing.TheAndroidplatformsupportsthreebroadcategoriesofsensors:Android平臺支持三大類傳感器:Motionsensors運動傳感器Thesesensorsmeasureaccelerationforcesandrotationalforcesalongthreeaxes.This

categoryincludesaccelerometers,gravitysensors,gyroscopes,androtationalvectorsensors.這類探測器通過三個軸測量加速力量和旋轉(zhuǎn)力量。包括加速計,重力探測器,陀螺儀,和穿轉(zhuǎn)矢量傳感器。Environmentalsensors環(huán)境傳感器Thesesensorsmeasurevariousenvironmentalparameters,suchasambientairtemperature

andpressure,illumination,andhumidity.Thiscategoryincludesbarometers,photometers,andthermometers.這類探測器測量各種環(huán)境參數(shù),例如環(huán)境的氣溫與氣壓,光照與濕度。包括氣壓計,光度計,和溫度計。Positionsensors位置探測器Thesesensorsmeasurethephysicalpositionofadevice.Thiscategoryincludesorientationsensorsandmagnetometers.這類探測器測量設(shè)備的物理位置。包括定位傳感器和磁力計。YoucanaccesssensorsavailableonthedeviceandacquirerawsensordatabyusingtheAndroid

sensorframework.Thesensorframeworkprovidesseveralclassesandinterfacesthathelpyouperformawide

varietyofsensor-relatedtasks.Forexample,youcanusethesensorframeworktodothefollowing:通過使用Androidsensorframework,你可以訪問到設(shè)備上可用的探測器并獲取原始的探測數(shù)據(jù)。這個探測框架提供了幾個類和接口幫助你執(zhí)行一系列探測器相關(guān)的任務(wù)。例如,你可以使用sensorframework來做以下事情:Determinewhichsensorsareavailableonadevice.確定設(shè)備上那些探測器可用。Determineanindividualsensor'scapabilities,suchasitsmaximumrange,manufacturer,powerrequirements,andresolution.確定某個探測器的功能,例如最大探測距離,制造商,供電要求,和分辨率。Acquirerawsensordataanddefinetheminimumrateatwhichyouacquiresensordata.獲取原始探測數(shù)據(jù)并定義獲取數(shù)據(jù)的最小速度。Registerandunregistersensoreventlistenersthatmonitorsensorchanges.注冊和注銷監(jiān)測探測器變化的sensoreventlistners。Thistopicprovidesanoverviewofthe

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論