gpt4 book ai didi

android - ActivityRecognition 如何工作?

转载 作者:行者123 更新时间:2023-11-29 21:04:31 25 4
gpt4 key购买 nike

我很想知道 GooglePlay 服务中的 ActivityRecognition 是如何工作的?

  • 我认为加速度计数据可以识别 Activity 。对吗?请告诉我详细情况如何?

最佳答案

我也在寻找这个答案,您的帖子是 Google 上的热门搜索结果之一。我做了更多的挖掘,发现了这个 https://developer.android.com/reference/com/google/android/gms/location/ActivityRecognitionApi.html其中说:

The activities are detected by periodically waking up the device and reading short bursts of sensor data. It only makes use of low power sensors in order to keep the power usage to a minimum. For example, it can detect if the user is currently on foot, in a car, on a bicycle or still.

它没有明确说明它使用了哪些传感器,但我们可以放心地假设加速度计是其中之一。因为它说传感器(复数),所以它显然使用了其他传感器。但是因为它说低功率你不必担心它使用 GPS 或类似的东西。但是,它确实表示它会唤醒设备,从而使其退出 super 省电模式。因此,即使它的功率很低,您仍然可能不希望它整天每 5 秒运行一次。进一步向下的文档说:

A common use case is that an application wants to monitor activities in the background and perform an action when a specific activity is detected. To do this without needing a service that is always on in the background consuming resources, detected activities are delivered via an intent. The application specifies a PendingIntent callback (typically an IntentService) which will be called when activities are detected. See the documentation of PendingIntent for more details.

关于android - ActivityRecognition 如何工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24994951/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com