gpt4 book ai didi

android - 从三星 Galaxy Watch4 上的传感器检索心率数据

转载 作者:行者123 更新时间:2023-12-05 00:02:32 25 4
gpt4 key购买 nike

有谁知道您需要使用哪个 API 来获取 Watch4 上的实时传感器数据。我尝试了在 Android 开发者网站上找到的各种方法,但都没有运气。
这是我尝试使用 MeasureClient 时遇到的错误:

2021-09-12 23:18:06.642 7451-8864/com.example.measuredata E/ServiceConnection: Connection to service is not available for package 'com.google.android.wearable.healthservices' and action 'com.google.android.wearable.healthservices.MeasureClient'.
2021-09-12 23:18:06.661 7451-7451/com.example.measuredata I/ViewRootImpl@6d4920d[MainActivity]: Relayout returned: old=(0,0,450,450) new=(0,0,450,450) req=(450,450)0 dur=34 res=0x7 s={true 3985306624} ch=true fn=-1
2021-09-12 23:18:06.801 7451-8864/com.example.measuredata E/ServiceConnection: Connection disconnected and maximum number of retries reached.
java.util.concurrent.CancellationException: Service not available
at androidx.health.services.client.impl.ipc.internal.ServiceConnection.connect(ServiceConnection.java:145)
at androidx.health.services.client.impl.ipc.internal.ServiceConnection.enqueue(ServiceConnection.java:203)
at androidx.health.services.client.impl.ipc.internal.ConnectionManager.handleMessage(ConnectionManager.java:123)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:246)
at android.os.HandlerThread.run(HandlerThread.java:67)

最佳答案

看看新的健康服务 API https://developer.android.com/training/wearables/health-services
甚至还有来自三星的示例代码
https://developer.samsung.com/health/blog/en-us/2022/01/14/using-health-services-on-galaxy-watch
它处于 alpha 状态,但我目前正在使用计步器,它运行良好。

关于android - 从三星 Galaxy Watch4 上的传感器检索心率数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69154994/

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