Search code examples
androidkotlinalarmmanager

Alarm manager isn't working correctly on android version above 8


In my app I used Alarm manager for time scheduling. For that I used Alarm Manager API .

  • I am using setInExactRepeating() method for repeat my alarm but it's not triggering my alarm when my device is in idle condition. Also sometimes it delays to triggering alarm.
  • For my app its important to trigger the alarm at the exact time in repeating mode also in idle condition.

Please help how can i resolve this issue, I also learned about Job scheduler and Work manager but these have not a feature like alarm manager to set alarm at exact or repeat.

Thank You


Solution

  • You probably can't do any with repeat because on higher android there is a limitation for repeating (i think 15m) for better performance and battery saving and Alarm manager on higher android isn't the best.

    Even if you manage to do so and make your app it will probably be killed by performance controller applications or even android OS itself. and I don't suggest investing your time in it because of this.

    There were few tricks to trick the android OS and get your app running but I think it will be really messy to code that. the best thing to work is the same WorkManager as you say