Alarm Manager now is about to deprecated, because of Google's OS implementation, Api Update, Background Service Restriction (As some Information Here ), Device Doze Mode, etc, and Mobile Manufacturing Companies wants to prevent app behavior which is harmful for there Device's Battery life as well as their reputations. For these two reasons actually Alarm Manager not working with updated devices, even with setExactAndAllowWhileIdle()
method and WakefulBroadcastReceiver
(As stated here. )
Then I go through the WorkManager worker class. But, even I use mWorkManager.enqueueUniqueWork
(Like another Stackoverflow answer says) this way :
OneTimeWorkRequest mRequest = new OneTimeWorkRequest.Builder(WorkerClass.class)
.setConstraints(Constraints.NONE)
.setInputData(inputData)
.setInitialDelay(diff, TimeUnit.MILLISECONDS)
.addTag(WORK_TAG)
.build();
mWorkManager.enqueueUniqueWork(WORK_TAG,ExistingWorkPolicy.REPLACE,mRequest);
The time triggering work also be pending, and when I restart the app for the next time Then the called Intent will remain top of the app stack. Actually Summarize - the work pending until the app will not start again. I saw that Alarm Manager also show up this same behavior. For a side note, the app is not in Battery Monitization Sleep List.
So, Actually, My burning question is, can I really make or develop an Alarm App now a days for updated api ? If, so, How to proceed ? Any help is Appreciated thanks.