温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Andrdoid Sensors Overview (探测器概述)一

发布时间:2020-06-21 09:34:08 来源:网络 阅读:352 作者:weijianzhenli 栏目:移动开发

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。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI