Hey,
I want to create a watchface with some graphical steps timedependend....but I find nowhere a object for that....but garmin uses this in his app, so there must be one
Hey,
I want to create a watchface with some graphical steps timedependend....but I find nowhere a object for that....but garmin uses this in his app, so there must be one
the app on Handy displays the steps per hour for the day...that has to be given by an object from the watch...but I don t find it in the manual
There is not standard API call that gets you that. You can get the current step count and time and calculate/maintain it yourself.
Yes I know and planned it in that way,the watch would then take the actual steps und collect them from that time on, but I would take them from the last 4 hours..... but I ve seen it already at ActiFace Watchface....there the developer takes not per hour but the steps of the last 7 daysw the endvalue....where are they saved in? When I inizialise it...there are there..that must be a object...
Use ActivityMonitor.getHistory() and you get the info for the last 7 days. But it's by day, not by hour.
You could get a reasonable estimate of this if you record the current step count at the top of every hour (using backgrounding if necessary) and then display the difference from the current step count to the step count 3 hours ago.
Is the last question how to read that object that comes there....
In getHistory(), it's an array of up to 7 History objects, one for each day. Look in the API guide to see what's there.
Get an Array of ActivityMonitor.History objects
Returns:
An Array of ActivityMonitor.History objects.
The Array will be a maximum of 7 objects
The objects will be inserted most recent first
Nice...got it in watchface AlienHR...but the app displays the steps in count over the hours of a day...the Array had just the steps reached per day