Documentation and example on FitContributor

I just today switched to SDK 2.1 and I would like to start playing with the fit files through the FitContributor method.
Where can I find some clear documentation or working example to start?
Thanks in advance.
  • Thanks for the information guys. I have come to same conclusion as you Moxy after playing with it for awhile. Looks like I'll just use a static string for the time being.

    Rob
  • You can look at what's in a .iq file (it's .zip format) and you'll see .json (files) there that's used for displaying FitContrib data in GC or GCM . You'll also see .json file(s) there if you have app-settings that's used by GCM or GE for that.
  • Yeah I do:

    <fitContributions>
    <fitField id="0" displayInChart="true" sortOrder="0" precision="2"
    chartTitle="@Strings.ItemNameLabel" displayInActivitySummary="true" dataLabel="@Strings.ItemNameLabel"
    unitLabel="@Strings.Units" fillColor="#FF0000" />
    </fitContributions>


    Also, I can see the fields show up in the Connect mobile app under "Connect IQ" of any given workout. Maybe I'm just don't know where to look on the Connect website. I'll keep poking around. Also, as far as I can tell the monkeygraph tool only works with .iq files not .prg and it's only ever crashed on me. YMMV.

    UPDATE: I'm now seeing my Fit developer fields on Garmin Connect under the activity details. I must have missed it before, sorry for wasting time here. Either way it's working now.

    Rob


    I am having the same issue: updated my datafield to write using FitContributor and correct metadata in resources files but nothing showing in the mobile app or GC website. I can see my data saved using monkeygraph (except for the summary tab, it is always blank). I created the vPower datafield and would like to write this in GC. Is this a timing issue to get working? Here is what I have done:
    1. Update to latest SDK.
    2. Set datafield project to use 1.3.
    3. Create 3 fields using FitContributor.
    4. Publish app, delete and reinstall on my 920XT.
    4. Data is in the FIT file, but nowhere else to be seen. The summary fields also do not display on the device (920XT) in summary view.

    Code:
    vPowerField = SimpleDataField.createField("vPower", 0, Fit.DATA_TYPE_UINT16, { :nativeNum=>34, :mesgType=>Fit.MESG_TYPE_RECORD, :units=>"watts" });
    vPowerFieldMax = SimpleDataField.createField("vPower Max", 1, Fit.DATA_TYPE_UINT16, { :nativeNum=>121, :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"watts" });
    vPowerFieldAvg = SimpleDataField.createField("vPower Avg", 2, Fit.DATA_TYPE_UINT16, { :nativeNum=>120, :mesgType=>Fit.MESG_TYPE_SESSION, :units=>"watts" });
    vPowerField.setData(0);
    vPowerFieldMax.setData(0);
    vPowerFieldAvg.setData(0);


    Resource file:
    <fitContributions>
    <fitField id="0" displayInChart="true" sortOrder="0" precision="2"
    chartTitle="@Strings.FieldChartTitle" dataLabel="@Strings.FieldName"
    unitLabel="@Strings.FieldUnit" fillColor="#FF0000" />

    <fitField id="1" displayInChart="false" displayInActivitySummary="true" sortOrder="1" precision="2"
    dataLabel="@Strings.FieldNameMax"
    unitLabel="@Strings.FieldUnit"/>

    <fitField id="2" displayInChart="false" displayInActivitySummary="true" sortOrder="2" precision="2"
    dataLabel="@Strings.FieldNameAvg"
    unitLabel="@Strings.FieldUnit" />
    </fitContributions>
  • Saved metrics in fit file of Fenix3 device not showing in GarminConnect

    Hi,

    I have various FIT files (fenix3 device) with the metrics saved in them but when i upload to Garmin Connect not appears. The same App work pefectly in the EDGE devices.

    ¿which may be occurring?


    Thanks
  • scoetser75,

    Just to confirm, are you calling the "setData()" method on your data fields? It sounds like you are given you confirmed that you can see the data in you FIT file, but just want to confirm. Also, as far as I can tell developer fields are not shown on the summary page of the devices and that behavior is the same on my Edge 520. It took me a bit to find the custom fields on GCM and the website, but here's how to find the data:

    GCM (Android) - Click the menu button in the top left, select Activity Stats, pick your activity type (Running, Cycling, etc), select the activity from the list at the bottom of the screen, select the second icon that looks like a page to see activity details, scroll to the bottom and your fields (at least summary fields) should be listed under "Connect IQ".

    On Connect.Garmin.com - Select the menu button at the top left, select "Activities", click the activity name in the list, scroll down and your items should be listed under "Connect IQ". I'm assuming your graphs would be here too, but I've only created summary fields and haven't tested graphing yet.

    Also, I'm not 100% certain, but I believe there is some kind of lag when publish your app to when the data starts showing up on GCM and the web site. I couldn't find my data fields any where the first day and then magically they just showed up. Also, I've updated my field labels and it's taken a few hours before I see the changes on GCM and the web site. YMMV. As explained in this forum, the service, for whatever reason, doesn't actually read your fields from the FIT file. Instead it uses a JSON object that is stored with your app, so that has to be processed/updated when you upload your app.
  • Thanks for taking the time to respond ChubbyCrusher.

    Yes, I use setData() on all my fields. As explained, I can see the recorded data successfully in the FIT file and the graph generates when viewed through monkeygraph as a test. So the data is there, but nowhere to be found in the mobile app or GC website.

    Please help, this is VERY frustrating!

    Thanks
  • Thanks for taking the time to respond ChubbyCrusher.

    Yes, I use setData() on all my fields. As explained, I can see the recorded data successfully in the FIT file and the graph generates when viewed through monkeygraph as a test. So the data is there, but nowhere to be found in the mobile app or GC website.

    Please help, this is VERY frustrating!

    Thanks


    Hi scoetser, I looked over your code and didn't see any problems but I'm not much of a programmer so I wouldn't put much confidence in that.

    One thought that might be occurring is that you are somehow running a sideloaded version of the data field rather than the version downloaded from the AppStore. If you look on the watch Garmin\Apps folder, an app store .prg file will be an 8 digit hex looking file name (like 1EDA521F.PRG). A sideloaded .prg file will have the name that you gave it (like mydatafield.prg). I think the sideloaded version won't put the correct AppID in the FIT file so GC won't associate the data with the datafield metadata that you uploaded to the App store.

    I think this issue might not come into play with MonkeyGraph so that's why it works there.

    I don't understand all of the automatic checking that is done when the data field is installed from the store. It might be a good idea to delete all sideloaded stuff from the watch and then reinstall the data field via the App store.

    I'm not sure at all that this is your problem. Just something to try.
  • Thanks MoxyRoger,

    Yea, that was one of the things I checked and I do not have a side loaded app. My sessions actually do not want to automatically update to Strava (says file is corrupt). So something is wrong. I will remove all my files and add them one by one to test.

    Thanks anyway.

    Cheers
  • Thanks MoxyRoger,

    Yea, that was one of the things I checked and I do not have a side loaded app. My sessions actually do not want to automatically update to Strava (says file is corrupt). So something is wrong. I will remove all my files and add them one by one to test.

    Thanks anyway.

    Cheers


    After doing a bunch of dev work with my Edge 520, my FIT files wouldn't upload to Strava any more. You can usually fix them with the fittools website, but I've found the best way to clear the problem is by doing a factory reset on the device.

    Rob
  • Seems like I fixed the issue (at least part of it). My data is now uploading and displaying in mobile app and GC web. There still seems to be an issue uploading files automatically into Strava. Indoor rides come through as zero distance! What's up with that!!!??