• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

AlarmManager not working for 5 minutes periodic update

In my application I was using the setRepeating method of the AlarmManager class to perform the data update every 5 minutes. But in newer versions this logic started to have problems triggering the alarm. Searching, I saw that this method is not accurate, due to the concern of optimizing the battery on the part of the OS. I saw that there are methods like setExact and setExactAndWhileIdle, they are not as exact as the name suggests, because they admit a certain delay, mainly when the device is inactive. WorkManager I cannot use because I am dealing with a time of 5 minutes and the minimum of it is 15 minutes. Unfortunately, this time is not flexible, I need it to be 5 minutes and allow exact updating even with the device inactive. Is there any way to achieve this behavior?
 
Back
Top Bottom