A reminder is a promise with a time on it. The user said "remind me at 9:00", and if the notification arrives at 9:40, or after the next reboot, or never, the promise is broken. Android gives you several ways to run code later, and each one trades precision for battery. This post picks the right one for each job and makes reminders survive the three things that kill them: Doze, reboots and permission changes.
The menu of "later"
Need Tool Precision
Deferrable work: sync, cleanup, a daily digest WorkManager Minutes to hours; runs when constraints allow
"Around this time" AlarmManager.set() / setAndAllowWhileIdle() Within an hour on Android 12+, unless battery saving delays it
"Within this window" AlarmManager.setWindow() Inside the window; short windows are usually stretched to 10 minutes
"At this minute", user-set setExactAndAllowWhileIdle() Nearly exact, even in Doze; needs exact alarm access
An alarm clock setAlarmClock() Exact; shown to the user as an upcoming alarm
Those figures come from…