I enable Simulation > Fit Data > Simulate Data and then I try to do following inside my watchface:
var graphData = []; if (ActivityMonitor has :getHeartRateHistory) { var getNext = true; var iterator = ActivityMonitor.getHeartRateHistory(120 /* count of entries */, true /* newestFirst */); while (getNext) { var sample = iterator.next(); if (sample != null && sample.heartRate != ActivityMonitor.INVALID_HR_SAMPLE) { graphData.add(sample.heartRate); } else { getNext = false; } } } System.println("size=" + graphData.size());
And I always get only 1 entry in the SIM (even after waiting a few minutes). Can I somehow simulate the history?