Skip to content
Preptima
mediumConceptDesignMidSenior

You need to run background work on Android - how do you choose between WorkManager, a foreground service, and AlarmManager?

4 min readUpdated 2026-08-15

Answer

Short answer

WorkManager is the default for deferrable work that must eventually run, a foreground service is for work the user is actively aware of right now, and AlarmManager is only for work that must fire at a specific wall-clock time regardless of system state.

Keep android explicit in the answer because that is the concept the interviewer is actually trying to test. A good android explanation names the trade-off, the failure mode, and the evidence you would use before choosing.

Was this answer helpful?

Likely follow-ups

  • What happens to a running WorkManager job if the OS kills the app process partway through?
  • Why does starting a foreground service without immediately calling startForeground() crash on modern Android?
  • How does WorkManager's own internal use of AlarmManager and JobScheduler change your answer about when to use AlarmManager directly?
  • What expedited work in WorkManager is for, and why isn't it a substitute for a foreground service?

Related questions

Further reading

Related Topics