This repository was archived by the owner on Aug 24, 2025. It is now read-only.
Continues to work with screen off? #1154
Answered
by
dennisguse
brianjmurrell
asked this question in
Q&A
|
If I start a recording and don't set the option to keep the screen on and then put my phone in my pocket will OpenTracks continue to sample the location data and sensor data for the duration of my activity? What prevents Android from thinking the app is idle/not-being-used and killing it as it seems to so aggressively do with apps in later Android releases -- in the name of battery efficiency? |
Answered by
dennisguse
Mar 11, 2022
Replies: 1 comment
|
OpenTracks uses a foreground service and a CPU wake lock. https://developer.android.com/guide/components/foreground-services |
0 replies
Answer selected by
dennisguse
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OpenTracks uses a foreground service and a CPU wake lock.
Some phones ignore this and then battery optimization must be disabled as well.
Huawei is problematic...
https://developer.android.com/guide/components/foreground-services