kochka / WeightLogger

WeightLogger Android app
Other
69 stars 23 forks source link

BMI does not show in garmin connect after import or upload #56

Open Abasz opened 3 years ago

Abasz commented 3 years ago

For some reason the BMI filed is left blank/not calculated in garmin connect after importing the weigh-in.

All other data is shown correctly. Alos if I add a weigh-in directly in garmin connect (but only able to enter weight) the BMI is calucated and shown properly).

I think this is a bug.

Thanks for the great app and for your help.

nurps commented 3 years ago

I think the app has to sent it to Garmin, it wont generate on import.

Abasz commented 3 years ago

So I did some research and it turns out a specific BMI field is necessary to be included in the FIT file. But this field is not specified in the FIT SDK Profile...

However, I was able to find this pull request that shows that the weight_scale message has a field with number 13 and a scale of 10.

Although that project is in Phyton, I tested this approach in C# (I don't have any java experience) and it works perfectly (i.e. adding field with number "13" and setting the BMI to, for instance, "251" would result in a 25.1 BMI in the garmin app after importing the resulting fit file).

So I think in the export function the BMI should be calculated and the appropriate field should be added to the "WeightScaleMesg".