How to vary heart rate sample length

Former Member
Former Member
Hello, I am trying to sample the heart rate during periods of very little activity. Therefore, I do not need readings every second, I would rather conserve battery life and read the heart rate at a lower rate

Looking at the docs, there is a Sensor.registerSensorDataListener which can set the period of readings, however it reads like it can only be applied to the accelerometer. Can it be applied to the heart rate sensor as well? If not, is there any other way to increase the time between readings?

Thanks,
George
  • The sampling rate is fixed, but can vary a bit based on the watch - the newer watches are 1 sec all the time, while some of the older ones, it will be less often unless your have an app that enables the sensor. (you can get the HR by way of Activity.Info.currentHeartRate instead of Sensor BTW).

    getHeartRateHistory saves the HR off every couple of minutes, so you can get data from that, or, you can just use a timer, and get the HR (Activity.Info.currentHeartRate) every 5 minutes or whatever...

    Watch faces that show the HR using 1hz do that by way of Activity.Info.currentHeartRate, and often have a fall back to the newest reading in getHeartRateHistory