Scheduling Tasks With Android WorkManager

In this WorkManager tutorial, you’ll learn how to schedule different kinds of tasks, test the tasks, as well as debug different tasks. By Harun Wangereka.

4.6 (11) · 1 Review

Download materials
Save for later
Share
You are currently viewing page 4 of 4 of this article. Click here to view the first page.

Requesting Diagnostic Information from WorkManager

WorkManager provides a way to get the following information:

  1. Requests that have been completed in the past 24 hours
  2. Requests that have been scheduled
  3. Running work requests

This information is available for debug builds. To get this information, run this command on your terminal:

adb shell am broadcast -a "androidx.work.diagnostics.REQUEST_DIAGNOSTICS" -p "com.raywenderlich.android.workmanager"

Your logcat displays the following information:

Diagnostic Worker Information

Where to Go From Here?

Download the final version of this project using the Download Materials button at the top or bottom of this tutorial.

Congratulations! You learned how to use WorkManager to run one-time, delayed, periodic, and long-running or important tasks in the background. You also learned how to write tests for your workers.

To learn more about WorkManager, check out the WorkManager official documentation.

I hope you enjoyed the tutorial. If you have any questions or comments, please join the forum discussion below.