ActivityMonitor and SensorHistory vs. Sensor

I am trying to understand why ActivityMonitor and SensorHistory may be implemented in the WatchFace project, but not Sensor. Is this for low power purposes? If so, then should I use for my watch face project ActivityMonitor for getting heartbeat or SensorHistory? It seems I will need to use both as one keeps track of steps and calories while the other keeps track of elevation. Both seem to track heartbeat...thanks in advance!!

  • You can use Sensor in a WF but only in a background process which runs once ever 5 minutes at most.

    As far as getHreartrateHistory(), the two (AM and SH versions) are basically the same but they show an invalid HR differently.  In AM you see 255, in SH, a null.

    But, they both only update every couple minutes.

    On most watches with OHR, the trick is to start with Activity.getActivityInfo().currentHeartRate.  If it's not null, use it.  If it is null, you can get the newest sample from getHeartRateHistory().

    Of course if you want to display it on a watch face is "almost real time", you'll want to use onPartialUpdate() as you would for seconds in a WF that displays seconds all the time.