I am writing various items to the FIT file using the command
field = createField("Hour", 3, FitContributor.DATA_TYPE_FLOAT,{:mesgType=>FitContributor.MESG_TYPE_SESSION});
Then in the FITContributions.xml I have
<fitField id="3" displayInActivitySummary="true" sortOrder = "10" precision="1" dataLabel="@Strings.nm_label" unitLabel="@Strings.nm_units" />
Then in Strings.xml I have
<string id="hour_label">Best Hour</string> <string id="hour_units">kts</string>
This all works great and I see the units in "kts" when I look at my activity in Garmin Connect.
What I would like to do is for the user to be able to select either kts, mph or kph. which I can do with User_Units = Application.getApp().getProperty("Units");
How do I change the string id "hour units" from within the code?
I could create a another field in the code, then another entry in the Fitcontributions and then another entry in String.xml.
field = createField("Hour", 4, FitContributor.DATA_TYPE_FLOAT,{:mesgType=>FitContributor.MESG_TYPE_SESSION});
<fitField id="4" displayInActivitySummary="true" sortOrder = "10" precision="1" dataLabel="@Strings.nm_label" unitLabel="@Strings.nm_units" />
<string id="hour_label">Best Hour</string> <string id="hour_units">mph</string>
But surely there must be a better way?