07-11-2020 16:18
07-11-2020 16:18
My clockface shows the steps for the current hour as well as the steps for the previous hour. These are not accurate when the user first loads my clockface or if they have had another app active for a while. So I was going to use the new ActivityHistory and minuteHistory.query to calculate these counts. While testing out the retrieval of the ActivityHistoryRecord, it looks like the maximum I can pull back is 60 minutes, just wondering if this is a limitation everyone else is seeing, or if I am doing something wrong? I can certainly use this to calculate the steps for the current hour, but I need to be able to go back 120 minutes to figure out the steps for the previous hour. Has anyone been able to retrieve minute history for more than 60 minutes? If that is a limitation of the SDK, that would be asinine, especially considering there is a minuteHistory and a dayHistory, but no hourHistory.
Also, do the ActivityHistoryRecords have a timestamp, or do you have to figure out when they were from based on the index?
07-11-2020 16:41
07-11-2020 16:41
The minute history is limited to 60 records, and there are no timestamps. You have to determine the time to which each record correponds based on the index and the time at which the query was executed.
07-13-2020 09:36
07-13-2020 09:36
This is what I figured based on my experimenting, but it is rather frustrating. I guess I can understand the limit of 60 minutes on minuteHistory, but why don't they expose an hourHistory interface? It makes no sense to have minute and day, but skip hour.
Thanks for your confirmation of the limitations of ActivityHistory.
07-14-2020 16:22
07-14-2020 16:22
@BamaBob wrote:This is what I figured based on my experimenting, but it is rather frustrating. I guess I can understand the limit of 60 minutes on minuteHistory, but why don't they expose an hourHistory interface? It makes no sense to have minute and day, but skip hour.
Thanks for your confirmation of the limitations of ActivityHistory.
Yeah,...my solution to recording hourly steps was to trigger a record every hour. If the user switched to something else, it pro-rates the accumulated steps to each hour that has passed after control is returned to the watch face. It's not perfect but usually close enough to determine if 250 steps were walked in each passing hour.
I did try the step history and it absolutely does work as explained, but the neither time frame available was helpful for recording hourly steps.
Regards,
Reign