Pick the fix
A fitness app tracks a run with GPS while the screen is off. Which approach fits current rules?
Hint 1 of 1
Is the work deferrable, or must it run continuously now?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A A foreground service of type location, with its notification and permissions
Correct. Ongoing, user-visible location work is exactly what this type is for.
Why not the others?
- B A periodic WorkManager job every minute. Periodic work runs at most every 15 minutes and isn't continuous.
- C A plain background Service. It would be stopped shortly after the app leaves the foreground.
- D An IntentService (deprecated since Android 11). It's deprecated and still a background service.