Session information and data fields

Former Member
Former Member
I'm a little stuck.

My pmDuo app (which I'll expand into my Triathlon app) creates three sessions - Cycle, Transition, and Run.

I manually track time based on Sys.getTimer(), but I'm not sure how to get information such as Pace, Speed, Distance (basically the data fields) etc.

Does anyone know how to do this? The ActivityRecording sample doesn't provide any feedback. I looked at ActivityTracking, but that only seemed to relate to the "steps" widget


Also, the Transition session doesn't save in the History, is this a bug? or should I be saving my sessions under Multisport with subsports?
  • You will have to get the details from theSensor module. I haven't played with the transition activity type yet, so I don't have anything useful to say about that.
  • Former Member
    Former Member over 10 years ago
    Hmmm, well, I'm already using the Position module, so I could just get speed from that, I guess.

    Though I'm not sure how I'm supposed to work out the distance though?
    Maybe something like:

    (currentPositionInfo.when - previousPositionInfo.when) * currentPositionInfo.speed

    ??
  • I'm mistaken. You can use the Activity.getActivityInfo() for the information you seek.

    You may need to enable gps via Position.enableLocationEvents(), and sensors via Sensor.enableSensorEvents() to get some data filled in and recorded in your fit files. I haven't read anything to say it is necessary, but I don't know that the documentation is complete in this respect..

    Travis
  • Former Member
    Former Member over 10 years ago
    I'm sure I tried Activity.getActivityInfo() and it just crashed my watch (though I didn't fully check for nulls). Will give it another go though.

    GPS is already enabled, though I don't enable Sensor events. What's the difference between Location events and Sensor events? (In the settings, the GPS is listed under sensors). I'm wondering if I need to do that to get the information that I need.

    Will give it a try
  • Former Member
    Former Member over 10 years ago
    Thanks, seems to work. Looks like the crash was related to some calculations I was doing with the data, rather than the data