Android: Scheduling a repeating task for short time intervals isn't working
<p>In Android, I have an activity which schedules a task(showing a notification) to repeat for every 10 or 15 mins even if the app is closed or killed.</p>

<p>I have tried to schedule it using <code>AlarmManager</code> with <code>alarmManager.setExact</code>, <code>alarmManager.set</code> and <code>alarmManager.setRepeating</code> and none of them fired the event at exact time. There is a lot of delay in firing the event. Sometimes it fire at exact time and sometimes there will be delay. The delay ranges from 15 mins to several hours.</p>

<p>I saw the android docs saying that AlarmManager will delay the events starting from Lollipop 5.1. I have tried it with <code>Handlers</code> as well as <code>TimerTask</code> and <code>Timer</code>, but they get killed immediately when app is killed.</p>

<p>Is there any alternate solution which runs for short interval times and runs in the background too.</p>