Understanding the Jetpack WorkManager library
WorkManager is one of the most powerful Jetpack libraries, and it is used for persistent work. The API allows observation of persistent status and the ability to create a complex chain of work. When building Android applications, it might be a requirement to have your data persist; if you need help to refresh your knowledge, you can reference Chapter 6, Using the Room Database and Testing.
WorkManager
is the most-recommended API for any background process and is known to handle unique types of ongoing work as shown here:
- Immediate: As the name suggests, these are tasks that must be done immediately or completed soon
- Long-Running: Tasks that run for a long time
- Deferrable: A task that can be rescheduled and can be assigned a different start time and can also run periodically
Some more sample use cases where you can use WorkManager
are, for instance, if your company wants to create custom notifications, send analytics...