ActivityRecord.Session and Timer

Hi everone,

  I'm just starting out with Connect IQ, having played around with DataField and now looking at my first application. Could someone shed some light on the connection between an activity session and a timer. Does the session have some sort of timer (how long you have been doing something) available or do you have to start a separate timer? One would think that the FIT recording would need timestamps internally in any case. 

  In my DataField I had the ActivityMonitor automagically delivered to my compute(info) callback but when I in my application tried to access ActivityMonitor.getInfo() manually, I end up with Error: Symbol not found even if I imported "using Toybox.ActivityMonitor"

Thanks in advance,

  Nik

  • 1) Start by looking at the record sample in the SDK.  That's a very basic recording app that allows you to create/start/stop/save a recording.   When you're recording you have access to Activity.Info,  (it's the "info" passed to compute() in a DF).  And in that you have elepseTime and timerTime.  elapsedTime is the time (in ms) since you first started recording (including pauses) while timerTime is the time (in ms) that you are recording (not including pauses).  In the record sample you'll probably want to include your own timer, so every second you read Activity.Info and then update the screen (Ui.requestUpdate()) so you can see the values change on the screen.

    2) ActivityMonitor is different than Activity.  ActivityMonitor is the 24/7 stuff like steps and floors.

  • Ah, thank you, I think I got it now. I create a session an a timer and register a callback for the session TimerEventListener so that the timer is in sync and the timer callback fetches the data and requests the redraw