Hi, I would like to make a widget that shows the number of kilometres run the past week/month.
I looked into ActivityMonitor, but it doesn't help much. Where can I find these statistics?
Hi, I would like to make a widget that shows the number of kilometres run the past week/month.
I looked into ActivityMonitor, but it doesn't help much. Where can I find these statistics?
They aren't available in CIQ
They are both data fields, so they themselves keep the data to date in persistent storage. So not something that be done in a widget.
In the sim, under FIT simulation is Activity Monitoring>set Activity Monitor Info.
You can do things there like set x steps per minute, as well as the 7 day data.
Thanks. But how are apps like these made then?
https://apps.garmin.com/en-US/apps/b6775385-c720-465a-b5dc-c37e4b753ae9#0
https://apps.garmin.com/en-US/apps/8903a9c1-c9fc-48e8-8265-9ef1103a6814
They are both data fields, so they themselves keep the data to date in persistent storage. So not something that be done in a widget.
Thanks again! Guess I will have to use the distance value in ActivityMonitor then.
Any idea how the distance is computed? I have a Vivoactive 4
Day to day, steps X stride length, but activities are also included.
Cool, thanks. Another thing, as I see it:
I need to save the data locally to display more than 7 days of history. But this approach demands that I open the widget at least every week, right? Or is there some clever way to do it in the background?
There's a way, but it's a bit complex and involves using a background process. Have the background run say every night at 23:59, and using getBackgroundData, add it to the data for the widget that it hasn't seen yet.
So I have worked a bit on this widget now. A problem I am facing is with the simulator
ActivityMonitor.getInfo().distance always returns 0, even when I have simulated activity through Simulation -> FIT Data -> Simulate data
Makes debugging difficult
In the sim, under FIT simulation is Activity Monitoring>set Activity Monitor Info.
You can do things there like set x steps per minute, as well as the 7 day data.
Any idea why ActivityMonitor.getInfo().distance and ActivityMonitor.getHistory().distance returns the value in feet?
I set the values in the simulator, then I print them. I thought it was supposed to be in centimeters?