How can I run the jobscheduler in doze or non doze mode i.e I want to run the bg job all the time. Is it possible?
JobInfo jobInfo
= new JobInfo.Builder(MYJOBID, jobService).setPeriodic(15 * 60 * 1000L)
.setExtras(bundle)
.setPersisted(true)
.build();
There is tow way to implement what you want.
Use alarm manager with setExactAndAllowWhileIdle() or setAndAllowWhileIdle()
Use WorkManager
I personally suggest you please try with workManager.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With