Android Inspect WorkManager Database

WorkManager provide a very minimal API to check on status of scheduled work, mainly WorkInfo which only tell the current state of the work, but not when it started or when it will run next.

I have a work where the status always returned ENQUEUED, but it never run.

Setup Database Viwer/Inspector With Stetho.

You can check the database at Web SQL -> androidx.work.workdb -> WorkSpec.

From here you can acess fields such as

  • state
  • initial delay
  • period_start_time

From here I realize the work is started 6 days ago with an initial delay of 24h, and the current state=0 (enqueued). I guess this work is stucked forever as enqueued, unless I replace it.

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.