Android Shorts 🩳: WorkManager + Hilt

Costa Fotiadis
Mar 30, 2023

Add (more) dependencies

Declare a dagger module

Make it easy to inject the singleton WorkManager instance anywhere.

Debug logging level is optional.

Customize the application class

We already declared the WorkConfiguration up above in the dagger module.

Might as well use it.

Fix up the manifest

Declare a worker to try things out

Assisted is the trick here.

Use WorkManager anywhere

Android Shorts — An attempt at writing a short walkthrough that reads in a minute or less. See also: fool’s errand.

--

--