I have an app that uses both periodic and onetime workers to perform various tasks, some of which require a network connection. My client reported to me that a certain required daily task was not performed on a day he did not use the app at all. Despite the app's not having been run on a given day, the workers still need to run in order to report various statistics to the backend server. I assume this is due to the fact that the app was in App Standby Mode for the entire day, as well as the device's being in Doze Mode for at least part of the day. So my question is, is it possible to make a periodic or onetime worker run while the app is in App Standby or Doze Mode, or will it always be delayed until the device and/or app wakes up?
Alternatively, would I be better off using alarms instead of workers? I see that it is possible to set an alarm using setExactAndAllowWhileIdle()
that "will be allowed to execute even when the system is in low-power idle modes." Does "idle mode" imply Doze and/or App standby mode?
I have been grappling with this for a while now, so any help and/or guidance is greatly appreciated.