This is how I get the number of burnt calories throughout the day in my code:
calorieStatus = ActivityMonitor.getInfo().calories
When testing with the simulator, since there was no way to set calories in the simulator, I wasn't able to test it. But I uploaded a beta version and on my watch, that get-calories method does not work.
This is the full calories code:
var calorieGoal = UserProfile.getProfile().gender == 0 ? 2000 : 2500;
var calorieStatus;
if(ActivityMonitor.getInfo().calories <= 0) {
calorieStatus = 0;
} else if(ActivityMonitor.getInfo().calories >= calorieGoal) {
calorieStatus = 1;
} else {
calorieStatus = ActivityMonitor.getInfo().calories / calorieGoal;
}
Where the point is to fill a bar out of 100%, so that is why I am using numbers from 0 to 1.