Can I get time of day when playing back an activty (from fit file)?
I mean - it was recorded by real F5 watch couple weeks ago and I'd like to see those real timestamps when playing this fily in my code.
Can I get time of day when playing back an activty (from fit file)?
I mean - it was recorded by real F5 watch couple weeks ago and I'd like to see those real timestamps when playing this fily in my code.
You get times in activity info, but not time of day (clock time).
You will see both elapsedTime (time since recording started including pauses) and timerTime (time the activity was recording - not paused). Both are in milliseconds.
Thanks!
I'm however still not really getting SensorHistory ... the code below prints still the same timestamps in simulator, no matter if I simulate or playback fit file. I'd expect that getNewestSampleTime would be pretty close to current time all the time, I see it about an hour old ... am I misunderstanding the concept of SensorHistory?
Activity is in progress, i.e. info.timerState == info.TIMER_STATE_ON is true
I just like to read values sensed 5 mins ago.
var elevantionIterator = Toybox.SensorHistory.getElevationHistory({});
if (elevantionIterator != null) {
System.println("oldest time : " + elevantionIterator.getOldestSampleTime().value());
System.println("newest time : " + elevantionIterator.getNewestSampleTime().value());
}
SensorHistory is canned data in the sim. It never changes. If I recall "when" is based on when the simulator itself is started.
Try it on a real device. BTW, the data in Activity.Info is more timely, as SensorHistory is only saved every few minutes.