android / health-samples

Apache License 2.0
269 stars 148 forks source link

Passive Data Sample doesn't work #68

Closed ZhEgor closed 1 year ago

ZhEgor commented 1 year ago

Hello guys, I faced the issue when the sample app displays 0 heart rate. I think PassiveDataService doesn't catch HEART_RATE_BPM, so I modified code and added passiveListenerCallback, but even there I don't receive heart rate. But when I replaced HEART_RATE_BPM with STEPS_DAILY, there weren't problems with receiving steps though. I don't think the issue in my watch, because in Google Fit app I can see my heart rate (min, max, etc.). But for your information it's Fossil Gen 6 (Wear OS 3). Any thoughts what's wrong? Any help would be helpful, thank you!

breanatate commented 1 year ago

With some devices, it may take several minutes for a value to be returned and displayed. About how long did you wait for the sample to return a heart rate value after toggling "Enable"?

ZhEgor commented 1 year ago

@breanatate I think 2 days, with short breaks to apply changes, so it wasn't full 2 days of work for the app

ithinkihaveacat commented 1 year ago

@ZhEgor Are you wearing the device when testing? Some data types are only returned when device is on a wrist (there's some separate "on body" detection hardware). Interesting that Fit works though. Does Samsung's Heart rate tile show the heart rate?

ithinkihaveacat commented 1 year ago

Sorry--obviously not Samsung! Is there an equivalent Fossil app (not Fit)?

ZhEgor commented 1 year ago

@ithinkihaveacat oh cool, I tried again and now it works 😵‍💫, don't know why this time it worked but I'm fine with that 😅. I think an issue is clossed. Thank you guys for your help.

Just in case anyone is facing the same problem: I removed the sensor permission for the Wellness app (default Fossil app) and reinstalled this app, don't know how it helped, but it did, matter of fact I had already reinstalled the app before, but it did nothing. Maybe there were some special circumstances...

ithinkihaveacat commented 1 year ago

@ZhEgor Great, thanks for the update!