What's the best way to calculate calories?

hi,

I have a climbing watch app that creates an activity on the watch (using ActivityRecording.createSession()) and display fields in a few pages. I'd like also show the calories burnt during the activity. Is there a way to get it from the watch / the activity somehow or should I calculate it by myself, I guess by using hr data, age, weight somehow?

There's this example of using a fit contributor, however I'm not sure I understand whether it's appropriate for the above scenario - I don't want to add a field to the saved activity, but rather just display the calories on the screen

https://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/FitContributor.html

Thanks!