Piyush Piyush - 4 months ago 21
Android Question

Precise method to set alarms in Android 6.0

,
setAndAllowWhileIdle()
and
setExactandAllowWhileIdle()
are the methods described in the documentation for an alarm to be able to cut through Doze and App Standby modes.

However, there have been reports by multiple nexus users who use Google Clock that the alarm did not work on their devices (Google Clock uses
setAlarmclock()
with
setExact()
method).

setAndAllowWhileIdle()
has been reported to be not affecting the Doze mode, whereas
setExactandAllowWhileIdle()
is said to be working, but only with a gap of 15 minutes.

I need to be able to schedule alarms with intervals of at least 5 minutes. What should be the right approach here?

Answer

I recently found that an alarm set with setAlarmClock keeps the device from entering IDLE mode within 2 hours of the alarm setting off. It seems like using setAlarmClock with setExactAndAllowWhileIdle is the best approach to go for on Marshmallow.

Comments