Abdur Rahman
Abdur Rahman

Reputation: 1001

Does Work Manager Wake The Application Class? Does It Run On Application Process or Another Process?

Android documentation does not clearly tells about what and how a work manager runs a work.

1. Does Work Manager start the application class so that initialization for some classes can be done or i have to manually initialize them in my Worker class.

2. Does It run on application process or it runs on another process?

3. Periodic work is not running if my application is killed. Why is that?

Upvotes: 4

Views: 1197

Answers (1)

Mohamed Moawia
Mohamed Moawia

Reputation: 566

  1. It store the jobs in a local database and tells the OS to run them using JobScheduler or gcmNetworkManger or AlarmManger depending on the API.

  2. The OS wakes the app when the constraints are met to run the scheduled job.

  3. Yes! if the user choice to force stop the app, the OS deletes all the scheduled job and the WorkManger won't be able to reschedule them until you open the app.

Upvotes: 3

Related Questions