10

I know this question has been asked before, here, but the answer given refers to documentation which is actually incredibly ambiguous. It says the inexact alarm might occur almost a "full interval" after the specified time. For alarms with an interval of a whole day, this would seem excessive.

The documentation does say here (under "RTC examples") that you can use inexact repeating for daily alarms, and gives an example of an inexact alarm being set for "approximately 2pm". Nobody in their right mind would think "approximately 2pm" might mean 1pm the next day, so it doesn't seem likely daily alarms at least can be "almost a full interval" after the specified time.

Is there any definite info out there about just how late an inexact alarm with a daily interval might be? Thanks.

(I know API 19 has "setWindow" but I'd like my app to work on older APIs too).

Community
  • 1
  • 1
joe_deniable
  • 2,562
  • 3
  • 28
  • 38
  • `It says the inexact alarm might occur almost a "full interval" after the specified time`. You already have your answer. – Phantômaxx Mar 10 '14 at 15:01
  • 1
    This contradicts the example in the documentation of an alarm going off at "approximately 2pm". "Approximately 2pm" can't possibly mean 23 hours later! – joe_deniable Mar 10 '14 at 15:03
  • Normally it won't. It tries to group alarms if in a reasonable closeness. If not, it will fire at a time the system finds comfortable (CPU / GC / ... other internal affairs it has to manage) - "approximately at the specified time". After all, it should be reasonably close to the time you set. – Phantômaxx Mar 10 '14 at 15:15
  • Possible duplicate of [How inexact is setInexactRepeating() for AlarmManager?](http://stackoverflow.com/questions/7129282/how-inexact-is-setinexactrepeating-for-alarmmanager) – Kas Hunt Feb 11 '16 at 15:24

1 Answers1

7

I've tested this with 5 consecutive alarms and the average delay, on my phone, was 11.8 minutes. This was with the interval between repeats set to INTERVAL_DAY.

joe_deniable
  • 2,562
  • 3
  • 28
  • 38