Scheduling WorkManager to send backups
WorkManager is a component of Android Jetpack designed to manage and schedule deferrable background tasks. It ensures these tasks run even if the app exits or the device restarts, and effectively handles retries and backoff strategies. As it also takes care of compatibility issues, alongside upholding best practices for battery and system health, WorkManager
is the recommended tool for tasks that require guaranteed and efficient execution.
WorkManager
uses an underlying job dispatching service based on the following criteria:
- It uses
JobScheduler
for devices with API 23 and above - For devices with API 14 to 22, it uses a combination of
BroadcastReceiver
(for system broadcasts) andAlarmManager
- If the app includes the optional
WorkManager
dependency on FirebaseJobDispatcher
and Google Play services are available on the device,WorkManager
uses FirebaseJobDispatcher
WorkManager
chooses the appropriate way to schedule a...