Fit Contribution not showing on Garmin Connect app (and web)

Hi,

I'm trying to add some additional statistics on the Activity summary shown on Garmin Connect (both in the smartphone app and web page). As far as I know from other pieces of code found in the forum and from the documentation, it should be pretty straightforward, but it is not working for some reasons. 
Here, I report a recap of the steps that I perform to accomplish this target:

In the resources I define my new fit contribution field:

<resources>
        <fitContributions>
                <fitField id="0" displayInChart="false" displayInActivityLaps="false" displayInActivitySummary="true"
                sortOrder = "0" precision="2"
                dataLabel="@Strings.label_hits_percentage"
                unitLabel="@Strings.label_hits_percentage_units" />
        </fitContributions>
</resources>

and my strings:

<strings>
    <string id="label_hits_percentage">Accuracy</string>
    <string id="label_hits_percentage_units">%</string>
</strings>


Then, I initialize my new activity session as follow:
    function initialize() {
       
        var hasRecording = Toybox has :ActivityRecording;
        if(hasRecording){
            //Create a new FIT recording session
            mSession = ActivityRecording.createSession({          
                 :name=>"EdgePredict",                              
                 :sport=>Activity.SPORT_GENERIC,                
           });

            mAlarmPercentageField = mSession.createField("ALARM percentage", FIELD_ID_ALARM_PERCENT, FitContributor.DATA_TYPE_FLOAT, {            :mesgType=>FitContributor.MESG_TYPE_SESSION, :units=>"%" /*, :nativeNum=>FIT_NATIVE_MSG_LAP_PLAYER_SCORE */});
           
            mAlarmPercentageField.setData(25);
       }
   }

then, before closing the app, i save everything by executing:

function save() {    
        var hasRecording = Toybox has :ActivityRecording;
        if(hasRecording && mSession!= null){
            System.println("File FIT salvato");
            mSession.save();
        }
}

The strange point is that I can find this parameter inside the .fit file if I convert it using FitToCsv.jar provided alongside the sdk, but then it does not appear as well on Garmin Connect. What I'm missing in the full process?


  • For this to work the app must be installed from the app store and can't be a sideload.  That's how Garmin Connect knows how to use the data

    You can mark your app as beta so only you can download it/

  • It makes sense. Thanks for your help!

  • I can find this parameter inside the .fit file if I convert it using FitToCsv.jar provided alongside the sdk

    This is a side note, but https://www.fitfileviewer.com/ is a great alternative to fittocsv, if you're looking to analyze FIT files.

    - it shows *all* the data in the FIT file

    - the UX is much better than fittocsv (since it's a web page and not a CSV file generator)

    - it shows a map / GPS track if applicable

    - it shows charts of your data

    - it shows data that Connect won't show (like wrist heart rate and external heart rate)

    - it can show raw numerical data *or* converted data with friendly names

    - unlike fittocsv, if it sees unknown data that it can't convert, it shows the raw numerical data (as opposed to fittocsv, which renders such data as "unknown", which effectively throws it away). The funny thing about fittocsv is it doesn't know about a lot of standard Garmin data that's present in ordinary activity FIT files

    - it has the ability to repair FIT files and it does a better job than fittocsv, which throws away a ton of data due to the previous point

    The only hypothetical advantage fittocsv has is that you can theoretically edit the resulting CSV file and convert it back to FIT. But in practice, this feature is useless, due to all the data that fittocsv renders as "unknown" (all of it will be thrown away when converting back to FIT).