I am creating a step tracking application where I get the data from GoogleFit. I use history API for that and get teh data of the steps during the day.
Now in my app the user can set a goal he wants to walk in one day, Say 10000/20000 steps in a day. And I wish to show a notification to the user whenever he/she completed the goal for the day.
Few ideas I looked into are : 1. I tried looking into goal API but there is shows as per the official documentation that we can read the goal user has set in google fit app, and we cannot set our custom goal.
- The second approach we thought of is to set alarm manager at particular time intervals and get the data from history API and then check if the goal is completed or not and then show the notification. But here there will be many wake calls to the phone and which I feel isn't a good idea.
Need help in getting a better approach for this use case, and if the 2nd method is good then how can we make sure there aren't many wake-call.