New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No movement detect also while driving in car #629
Comments
Yeah it's due to this:
The OS should report that you are in a vehicle however it is reporting But the OS has reported that you are still for 45 minutes! Two possibilities I can think of - It's possible that your phone is encountering doze mode or some aggressive task manager/memory optimizer. OR is your phone's Activity Recognition working (but it's possible that also gets affected by task managers)? I would go with the doze mode because I notice that the gaps are 5 minutes between recognitions. You could try an activity recognition app like - https://play.google.com/store/apps/details?id=com.mani.activitylogger&hl=en and see if it also reports a similar lack of movement. |
Your other issue #628 is the same thing. https://code.mendhak.com/gpslogger/#mytimeintervalhaspassedbutnopointwaslogged In Android 8 onwards, doze mode is more aggressive than before. There is no way around this without becoming a battery draining application. However doze mode itself is also tied to activity recognition. If the OS recognizes that you are moving about, then it won't go into aggressive doze modes. |
Retested with version 93. If have installed a test app "ActivityRecognitionExample". It is currently unclear if it is really related to the other App running in backgrund. I will retest it without the other app running in background. |
Without the other app running in background Activity recognition by the GPSLogger is much worse. |
The example in https://github.com/jamescoggan/activity-recognition-example is requesting the activity updates each 300ms. |
Yes - 60s isn't going to be very good quality, I've set it to match the user's logging interval. Having it set to <1s would make it a significant battery drain. In my testing when I hardcoded the activity recognition interval to 1s the battery impact was noticeable so I've not done it. |
It seems that the AlarmManager.setXYZ methods are activated with a very long delay. Also the setXYZWhileIdle is not waking up. I think I found another Mechanism which seems to ensure that the Alarm is triggered: AlarmManager.AlarmClockInfo info = new AlarmManager.AlarmClockInfo(System.currentTimeMillis()+ preferenceHelper.getMinimumLoggingInterval() * 1000, pi); At least in my short test the Alarm was triggered each 60s as expected. |
After some longer testing also with this approach no constant wakeup is possible. I will now check |
Also this seems not to work. |
Although there are ways that you can get the alarm manager to trigger exactly, these are expensive on battery - I'd like to respect the device doze mode. |
I am also facing issues with many missed points on Android 7 and 8 while walking, despite logging interval being set to every 60s. I noticed that deactivating the power-saving mode of the phone fixes the issue completely for me, so I guess this is related to "doze mode" like this issue is, thus I comment here. Other workarounds like turning off "battery optimisation" for the GPSLogger app do not make any difference. I have another GPS app that requested permission for "prevent phone from sleeping". GPSLogger does not have that permission. Maybe this would make a difference? |
Sorry late reply. The "prevent phone from sleeping" permission is what's known as wakelock. I've been avoiding this permission for years because it essentially keeps the CPU awake and doesn't respect battery constraints, I really don't want to go down that path. But it would most certainly make a difference at the expense of battery life. And by not doing wakelocks, you can see that the reliability is affected. It's a lose-lose situation. |
Related to Version 92
Mobile Phone: Honor 9, Android 8.0
App is running in background.
Also while driving 25min by car always no movement was detected, only the first position was logged.
debuglog_1.txt
Regards
Jens Lauterbach
The text was updated successfully, but these errors were encountered: