精品专区-精品自拍9-精品自拍三级乱伦-精品自拍视频-精品自拍视频曝光-精品自拍小视频

網站建設資訊

NEWS

網站建設資訊

AndrdoidSensorsOverview(探測器概述)三-創新互聯

Sensor Framework 探測器框架

You can access these sensors and acquire raw sensor data by using the Android sensor framework. The sensor framework is part of the android.hardware package and includes the following classes and interfaces:

10年積累的成都做網站、網站制作經驗,可以快速應對客戶對網站的新想法和需求。提供各種問題對應的解決方案。讓選擇我們的客戶得到更好、更有力的網絡服務。我雖然不認識你,你也不認識我。但先網站策劃后付款的網站建設流程,更有柳北免費網站建設讓你可以放心的選擇與我們合作。

你可以用android sensor framework 使用這些傳感器里獲得原始傳感數據。這個 sensor framework 是 android.hardware 包的一部分,包括以下類和接口:

  • SensorManager

  • You can use this class to create an instance of the sensor service. This class provides various methods for accessing and listing sensors, registering and unregistering sensor event listeners, and acquiring orientation information. This class also provides several sensor constants that are used to report sensor accuracy, set data acquisition rates, and calibrate sensors.

    用這個類來創建 sensor service 的實例。這個類提供多個方法用來使用和列舉 snesors,注冊和注銷 sensor event listeners,獲取定位消息。這個類也提供幾個 sensor 常量用于報告 sensor 精度,設置數據采集速率,和校準探測器。

  • Sensor

  • You can use this class to create an instance of a specific sensor. This class provides various methods that let you determine a sensor's capabilities.

    用這個類來創建一個 sensor 實例。這個類提供多個方法來讓你確定一個 sensor 的功能。

  • SensorEvent

  • The system uses this class to create a sensor event object, which provides information about a sensor event. A sensor event object includes the following information: the raw sensor data, the type of sensor that generated the event, the accuracy of the data, and the timestamp for the event.

    用這個類創建 sensor event object,提供關于一個sensor event的信息。一個sensor event object 包括以下信息:原始傳感器數據,產生event的sensor的類別,數據的精度,event的時間戳。

  • SensorEventListener

  • You can use this interface to create two callback methods that receive notifications (sensor events) when sensor values change or when sensor accuracy changes.

    可用這個接口創建兩個回調方法來接收通知(sensor 事件)當 sensor 值改變或者當 sensor 精度改變。

In a typical application you use these sensor-related APIs to perform two basic tasks:

你可以用這些 傳感器相關的API完成兩個基本任務:

  • Identifying sensors and sensor capabilities

    識別傳感器及其功能

    Identifying sensors and sensor capabilities at runtime is useful if your application has features that rely on specific sensor types or capabilities. For example, you may

    want to identify all of the sensors that are present on a device and disable any application features that rely on sensors that are not present. Likewise, you may want to identify all of the sensors of a given type so you can choose the sensor implementation that has the optimum performance for your application.

    在運行時識別傳感器及其功能在你的應用需要依賴某個傳感器類別或者功能時非常有用。例如,你可能想識別設備上所有的傳感器然后在應用中關閉沒有的傳感器的特性。同樣地,你可能想識別一特定類別的所有傳感器然后選擇性能對你的應用最優的。

  • Monitor sensor events

    監測傳感器事件

    Monitoring sensor events is how you acquire raw sensor data. A sensor event occurs every time a sensor detects a change in the parameters it is measuring. A sensor event provides you with four pieces of information: the name of the sensor that triggered the event, the timestamp for the event, the accuracy of the event, and the raw sensor data that triggered the event.

    監測傳感器事件是你獲取原始探測數據的方式。每當一個傳感器在測量時探測到某個參數改變,一個sensor 事件就發生了。一個 sensor 事件提供四條消息:觸發事件的sensor名稱,事件的時間戳,事件的精度,觸發事件的原始探測數據。

Sensor Availability

傳感器的可用性

While sensor availability varies from device to device, it can also vary between Android versions. This is because the Android sensors have been introduced over the course of several platform releases. For example, many sensors were introduced in Android 1.5 (API Level 3), but some were not implemented and were not available for use until Android 2.3 (API Level 9). Likewise, several sensors were introduced in Android 2.3 (API Level 9) and Android 4.0 (API Level 14). Two sensors have been deprecated and replaced by newer, better sensors.

Table 2 summarizes the availability of each sensor on a platform-by-platform basis. Only four platforms are listed because those are the platforms that involved sensor changes. Sensors that are listed as deprecated are still available on subsequent platforms (provided the sensor is present on a device), which is in line with Android's forward compatibility policy.

Table 2. Sensor availability by platform.

SensorAndroid 4.0
(API Level 14)
Android 2.3
(API Level 9)
Android 2.2
(API Level 8)
Android 1.5
(API Level 3)
TYPE_ACCELEROMETERYesYesYesYes
TYPE_AMBIENT_TEMPERATUREYesn/an/an/a
TYPE_GRAVITYYesYesn/an/a
TYPE_GYROSCOPEYesYesn/a1n/a1
TYPE_LIGHTYesYesYesYes
TYPE_LINEAR_ACCELERATIONYesYesn/an/a
TYPE_MAGNETIC_FIELDYesYesYesYes
TYPE_ORIENTATIONYes2Yes2Yes2Yes
TYPE_PRESSUREYesYesn/a1n/a1
TYPE_PROXIMITYYesYesYesYes
TYPE_RELATIVE_HUMIDITYYesn/an/an/a
TYPE_ROTATION_VECTORYesYesn/an/a
TYPE_TEMPERATUREYes2YesYesYes

1 This sensor type was added in Android 1.5 (API Level 3), but it was not available for use until Android 2.3 (API Level 9).

2 This sensor is available, but it has been deprecated.

另外有需要云服務器可以了解下創新互聯scvps.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業上云的綜合解決方案,具有“安全穩定、簡單易用、服務可用性高、性價比高”等特點與優勢,專為企業上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。


當前名稱:AndrdoidSensorsOverview(探測器概述)三-創新互聯
轉載源于:http://m.jcarcd.cn/article/dgdici.html
主站蜘蛛池模板: 国产视频精品分类 | 国产性爱一级 | 国产精品喷潮免费观 | 精品一区二区视频 | 日本一卡亚洲精品 | 国产香线 | 日本名勝景點推薦 | 乱码一二区在线亚洲 | 国产精品永久 | 动漫精品无 | 日本aa在线观看 | 国产老妇真 | 日本妇人 | 成人影视网 | 日本中文字幕精 | 日韩免费一区 | 日本亚洲午夜电影 | 国产亚洲精品bt | 日本中文字幕一本 | 日韩网站在线观看 | 91黑料在线观看 | 国产永久在线观看 | 中文字幕等等 | 欧美一区二区日韩 | 日本在线tv黄 | 99r精品在线观看 | 91美女福利 | 欧美性狂猛aa | 美日韩午夜福利 | 日韩激情偷拍第3页 | 国产精品色 | 日产国产欧洲系列 | 欧美日韩一级免费 | 国产男女爽爽爽免 | 精品高清亚| 91国内揄拍| 国产真实露脸 | 日韩在线观看精品 | 欧洲乱码伦视频免费 | 91大视频网站 | 日韩成人午夜福利 |