saintbyte / openbmap

Automatically exported from code.google.com/p/openbmap
Other
1 stars 1 forks source link

When in background, logging stops after ~3 hours #70

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start logging.
2. Switch to a different app and do something else for more than about ~3 hours.
3. Move away by a few hundred meters (preferrably *not* in a straight line).
4. Return to Radiobeacon and check the map view.

What is the expected output? What do you see instead?
I'd expect to see Radiobeacon return to its previous view, and see my last 
movements I made prior to returning to Radiobeacon (including all wifis) in the 
map view. Instead, I get the track list with a clock icon next to the current 
track. When I tap it and go to Map view, I see that the log seems to stop ~3 
hrs from the start, and was resumed only when I tapped it in the list again. 
Instead of my last movements prior to callind Radiobeacon again, I just see a 
straight line from where the log seems to have stopped, and no wifis during 
that period.

What version of the product are you using? On what operating system?
0.8.4, from F-Droid, on Cyanogenmod 11.0m11.

Please provide any additional information below.
Apparently Android kills the logging service. This can be prevented by making 
the service a foreground service. OSMTracker for Android had the same issue, 
see https://code.google.com/p/osmtracker-android/issues/detail?id=182.

Original issue reported on code.google.com by mich...@vonglasow.com on 18 Feb 2015 at 5:55

GoogleCodeExporter commented 9 years ago

Original comment by wish7code on 18 Feb 2015 at 8:55

GoogleCodeExporter commented 9 years ago
Pretty interesting stuff in the link you posted.

I wasn't even aware of the fact, that services could get killed. The 
setForeground API nevertheless seems to be deprecated for some time (
http://stackoverflow.com/questions/5647815/can-anyone-explain-the-service-setfor
eground-method)

I went for the startForeground method mentioned in above post instead. 
r9702d43b03b4 starts the Wireless Logging Service as a foreground service. 

Let's see whether this helps. There's still a chance that we have to start all 
services foreground (i.e. gps positioning, gpx loggging services), but I hope 
we can avoid that as each service started foreground would need a separate UI 
notification.

Another option would be to start wireless logging service as foreground service 
and restart other services as needed.

Original comment by wish7code on 18 Feb 2015 at 9:39

GoogleCodeExporter commented 9 years ago
Kept the client successfully running and tracking for ~5 hours in background 
(although no heavy CPU/RAM load during that time)

Original comment by wish7code on 19 Feb 2015 at 9:19