- Home /
How do I keep saving location updates even if my app is out of focus (Android)
I have this app that tracks it's user movements and draws the path on a map, kind of what fitness tracking apps do. Everything works fine when the app is open. But when the user goes back to the home screen and after some time returns to the app, the tracking resumes but no data was collected during the period the app was out of focus, ie, a straight line is drawn between the last update before the pause and the moment after the app is unpaused.
Well my question is pretty obvious, is there a way to force my app to keep saving the location updates even if it's out of focus. I already tried the Application.runInBackground = true, without any success (I know they clearly state that this property is ignored on Android and iOS, but I thought this could be already fixed, so I tried it anyway :p ).
Any help would be appreciated, especially because I have no experience in native Android development.
Thanks in advance
Your answer
Follow this Question
Related Questions
Starting Location Listeners Popup Android 1 Answer
Get Real GPS not WiFi GPS 2 Answers
Radius around GPS location 1 Answer
[Android 9.0 Huawei] LocationService updates only once per ~40 seconds 0 Answers