Activity.Info in a Watch App? is it possible?

Former Member
Former Member
Hi guys, a basic question from a newbie with connectIQ...

I'm developing a DataField type application getting usefully data from the Activity.info in compute() method of DataField class.

So, I tried to save a .fit file and I needed to switch to an app´s type application to be able to use ActivityRecording class who provides the methods to manage .fit files, I could create and save an fit file but y I lost the execution of compute methods and the date provides by Activity.Info

The question are:
- Can I access in any way to Activity.Info from a App type application?
- If not.. are there another way to get distance, averageHeartRate, etc. ?
- If not.. I must to calculate averageHearRate using raw data from Sensor.hearRate? distance calculating raw data from Position.Info? etc.

Sorry for my beginner level question. Thanks.

Max
  • Activity.getActivityInfo() does what you want.
  • Former Member
    Former Member
    Data Fields have the same capabilities as Applications to add custom data to .FIT files via the FitContributor module. If allowing the native application to control the timer works for your use case, you won't gain capabilities with the Application type.

    If you do feel you need a Application type, you can use Activity.getActivityInfo() as Jim mentioned. You will have to generate your own periodic event if you need it, because the compute() method is a special method that is only called for Data Fields.
  • Former Member
    Former Member
    Data Fields have the same capabilities as Applications to add custom data to .FIT files via the FitContributor module. If allowing the native application to control the timer works for your use case, you won't gain capabilities with the Application type.

    If you do feel you need a Application type, you can use Activity.getActivityInfo() as Jim mentioned. You will have to generate your own periodic event if you need it, because the compute() method is a special method that is only called for Data Fields.


    Thanks you guys , Activity.getActivityInfo() is exactly what I was needing. I will need to add custom data to my .FIT through FitContributor.
  • Former Member
    Former Member
    Data Fields have the same capabilities as Applications to add custom data to .FIT files via the FitContributor module. If allowing the native application to control the timer works for your use case, you won't gain capabilities with the Application type.

    If you do feel you need a Application type, you can use Activity.getActivityInfo() as Jim mentioned. You will have to generate your own periodic event if you need it, because the compute() method is a special method that is only called for Data Fields.


    Thanks you guys, It was exactly what I was needing.
  • With a watch-app, generally you'll need a timer so that onUpdate() is regularly called to update the screen, be that every second or minute based on the app itself.

    What I do is when onUpdate() is called in a recording watch-app, one of the first things I do is call Activity.getActivityInfo(), so I have the current info to display.

    For simple DF's there is no onUpdate(), and for complex ones, it's automatically called every second when the DF is visible. In watch-apps, they control when onUpdate is called, and there is no compute() that's called every second.