I was interested in developing an Android application a while back. I am not an experienced developer. I am a noobie who created his first Android app by using Google, Stackoverflow, and Youtube. So it may not be fair for me to rant about the horrible experience I had when I used Alarmmanager class in my app, but here I rant anyway.
First, the problem in the app.
My app needs to schedule notification accurately at a time every day.
The Solution.
The alarm manager class in the android library gives the developer access to alarm service, which the developer can use to schedule any task at a time within or outside the scope of the app. It was the perfect solution to my problem. I could execute the task(notification in my case) at a time using the Alarm manager. I needed to execute the task every day at the same time, and there were two functions that I could use from the Alarm manager.
setRepeating() — which can be used to execute the task exactly every day provided the time.
setInexactRepeating() — As the name implies, the alarm service will not fire at the right time. It synchronizes multiple Inexact alarm from different or the same app and fires approximately to save battery.