In past we had Alarm Manager, Intent Services, Implicit broadcast receivers, that can run even when app is not in the background.
But today (post oreo) we have Work Manager & Job Schedulers. They do the stuff for us when the app is not in the background, but they don't guarantee about the exact time of execution.
So today if I need to create an app, where user can set an Alarm, which will be triggered at 5:00 am 27 September 2021 seems not possible. (Skip 2020 for obvious reasons ;) )
Has anyone tried creating Alarm app post oreo OS, I know Gmail and other system do this, but as far as I know they have special permission to perform thee operation, which are not allowed to other apps.
AlarmManager is still valid for use on modern Android devices. The API documentation has a note about strict scheduling guarantees:
So, if you want to set an exact time to wake, you would use setExact() on API levels 19 and above.