We just finished a MAD Skills series on WorkManager. After we started the series by introducing WorkManager to new developers, we delved into the advanced uses of the library, including how to test and debug your WorkManager code. In the final episode, we showed you how to migrate old code from GCMNetworkManager and FirebaseJobDispatcher to WorkManager.
Check out the video here
Here’s a quick review of what we’ve learned.
1: WorkManager: The Basics
In episode 1, we explored the basics of WorkManager with The WorkManager Codelab. First, we saw how to define what you want to accomplish and how to make a work plan. Next, we implemented several different types of work, including one-time work and periodic work. This episode concludes with an introduction to App Standby Buckets to help you better understand how WorkManager plans to work.
Check out the video here
If you are using WorkManager for the first time, we recommend you read the following articles:
- The WorkManager profile
- WorkManager basics
2: WorkManager: Background Running tasks
In this episode, Ben gives you an in-depth look at how WorkManager handles multithreading. When working with threads, you can choose to use Executor, Coroutine, or RxJava, and Ben demonstrated each approach using the WorkManager. At the end of this episode, Ben also demonstrated how to return the results after the work is done so that the interface can be updated with it.
Check out the video here
If you want to use WorkManager with Coroutine, we recommend you read Florina’s article: WorkManager-Kotlin API.
3: WorkManager: Advanced Configuration and Testing
In episode 3, we showed you how to customize WorkManager initialization and how to support applications across multiple processes. We received questions from developers about testing and debugging, so Ben also went into depth on how to test workers and some practical debugging methods.
Check out the video here
4: migration from GCM NetworkManager and FirebaseJobDispatcher to WorkManager
In episode 4, we focused on migrating from the old job scheduling libraries (GCMNetworkManager and FirebaseJobDispatcher) to using WorkManager. Once your application starts targeting API level 30 and higher, GCM NetworkManager and FirebaseJobDispatcher will not work on Android 6.0 and higher devices. If your application is still using these two libraries, it’s time to update them and switch to WorkManager!
Check out the video here
5: Hugo talks about WorkManager
Android GDE Hugo Visser talks about why he chose to use WorkManager for a health app he recently developed, and how the library has helped his development efforts.
Check out the video here
6: Live q&A
The series ends with a Q&A session where we answer your questions about WorkManager. Watch the video for answers to all your questions, including the future plans of WorkManager, how to handle duplicate work, how to retry failed work, and more.
Check out the video here