BasicAirData / GPSLogger

A GPS logger for Android mobile devices
http://www.basicairdata.eu/projects/android/android-gps-logger/
GNU General Public License v3.0
403 stars 126 forks source link

Huawei P8 Lite - Android 6.0 - Stop logging after long inactivity #58

Closed gusioo closed 6 years ago

gusioo commented 6 years ago

Let's assume that I ride with GPS Logger about 13 km and then I stop to the break e.g. 45 min. After that, I start riding again (continue my previous ride) but GPS Logger does not record any activity. He stops recording and shut down the whole app.

Hardware/Probe/Firmware description

Huawei P8 Lite with Android 6.0. Battery optimization form GPS Logger is disabled so he can run in the background all the time.

Unexpected Behavior

Stops recording and don't resume after a long break.

How to reproduce the issue

Take some ride, and make a long break. GPS Logger must record all the time but after some time (I don't know how long) he stops recording.

PS. I have a GPX file from this issue. If it helps I can send an email.

GrazianoCapelli commented 6 years ago

Sadly every smartphone brand implements different optimization utilities (some very aggressive with background apps). Furthermore, antiviruses are known to be very aggressive with long running applications, and must be correctly set.

On Huawei smartphones (Android 6), if you want to run an app in background without be stopped, you first have to add that app to the list of the Protected apps.

Here you can find a video tutorial that shows how to protect an app. Please try to add GPS Logger to protected apps, and then repeat the test.

I await your kind feedback!

gusioo commented 6 years ago

On Huawei smartphones (Android 6), if you want to run an app in background without be stopped, you first have to add that app to the list of the Protected apps.

Yes, I know about that and I add GPS Logger to the protected app. I can register long distances without breaks. But If I had a longer break GPS Logger cannot resume tracking but the track is saved on the track list.

gusioo commented 6 years ago

OK, @GrazianoCapelli I found second "hidden" battery optimization in my Huawei.

Applications -> Advanced -> Ignore Optimiztaions.

GPS Logger was optimized. It's strange because I have selected GPS Logger as protected. Anyway - I disable this optimization and I check if GPS Logger kills my track again.

Thanks for your help.

GrazianoCapelli commented 6 years ago

Ok @gusioo, we'll wait the result of your test. In any case, please post a feedback for other users.

GrazianoCapelli commented 6 years ago

GPS Logger was optimized. It's strange because I have selected GPS Logger as protected. Anyway - I disable this optimization and I check if GPS Logger kills my track again.

@gusioo have you resolved the issue by disabling the optimization setting, or in another way?

gusioo commented 6 years ago

Hi @GrazianoCapelli Yes, when I disabled the hidden optimization GPS Logger logs all the time (when I need of course).

I wrote about this in my post: https://github.com/BasicAirData/GPSLogger/issues/58#issuecomment-427775954

Best regards, Jacek.