Retrieving Heart Rate Data From Sensors on Samsung Galaxy Watch4

Viewed 211

Does anyone know which API you need to use to get live sensor data on the Watch4. I have tried various I found on the Android Developer site and have had no luck.

This is the error I get when tried to use 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)
1 Answers
Related