2

I'm writing native code for getting the heart rate samples using react-native-google-fit I've tried aggregate method but it returns the average and not the resting heart rate.If I use the default read function I'll have all heart rate samples in given duration but don't know how to get resting heart rate or how to calculate it from the heart rate samples. Is there is formula to calculate it from the all samples?

    DataReadRequest.Builder readRequestBuilder = new DataReadRequest.Builder()
       .read(this.dataType)
       .setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS);
Markus Kauppinen
  • 3,025
  • 4
  • 20
  • 30
  • 2
    What research have you done already? – Collin Feb 03 '20 at 13:30
  • I couldn't find much in the documentations of google fit api, although while doing hit and trial, I've seen the resting heart rate among the sample heart rate results google fit api provides but there is no specific marker that would indicate that its the resting api so it wouldn't help as there are more than 10+ samples generated on even a minute and we can't distinguish it from the other heart rates. – Shayan Shokat Feb 03 '20 at 18:07
  • As for the terminology of resting heart rate, It's defined as heart rate of a person when he is in a state of rest. So, I list down the sample activities of person and tried to match the timestamps of those particular heart rates that shows as resting heart rate in the google fit app, with the activities of "still" and "unknown" but even that doesn't find me a match and I'm pretty much on a dead end here. – Shayan Shokat Feb 03 '20 at 18:07
  • 1
    So you can calculate a resting heart rate by taking the age from the user and substract it from 220. THen you have the maximum heart rate, Now the hard part. You need to find a point where the heartrate drops between certain times. A resting heartrate will be between 60 and 100 beats per minute. – Collin Feb 04 '20 at 08:25
  • I have the age of user let say, 27. Subtracting it from 220 gives 193. I have heart rate samples of 2 different days of this person, i.e. 1: maximum heart rate: 126 and then it drops to the lowest point i.e. 59, which is the resting heart rate in the app (sounds good) 2: maximum heart rate: 156 and it drops to the lowest i.e 55, but the resting heart rate on app is 77. Am I missing something? – Shayan Shokat Feb 04 '20 at 09:01
  • 1
    Maybe this helps? https://stackoverflow.com/a/65013967/2696508 – Mr L Nov 25 '20 at 23:13

0 Answers0