android.hardware.Sensor 和 Fitness.SENSORS_API 之间的区别

Difference between android.hardware.Sensor and Fitness.SENSORS_API

我正在寻找 android.hardware.SensorFitness.SENSORS_API 在性能和简单性方面的区别。

因为我在 Sensor API doc 上看到:

The API exposes data sources from hardware sensors in the local device and in companion devices. It also exposes data sources from applications. Data sources can be queried via findDataSources(GoogleApiClient, DataSourcesRequest)

在 Google 上搜索后,我看到存在 android.hardware.Sensor

所以我的问题是,这两者在性能、简单性和其他参数方面有什么区别?

是否有更好的方法来使用传感器记录步数或 activity 识别等?

祝大家有个愉快的一天!

解释两者的用法对于 Stack Overflow 来说过于宽泛。可以肯定的是,两者的文档应该涵盖您通常需要了解的大部分主题。

但是,为了给您一个简单的比较,Sensor API 负责从数据流中发送(健身)详细信息。来自文档(强调我的):

The API exposes data sources from hardware sensors in the local device and in companion devices.

"硬件传感器" 这里,(通常)指的是 built-in Android Hardware Sensors 或来自 Android Wear 设备(或类似的东西)。