Mapper: Track recording when screen is turned off

Created on 31 Dec 2015  路  16Comments  路  Source: OpenOrienteering/mapper

In your doc (part 3) you say:

Note that track recording is interrupted while the screen is off or the app is in the background to save battery. If you want to record a track, you need to keep the app active.

However as far as I remember the app also recorded when the screen is off (which also makes sense IMO).
And if this is not true then I would recommend to add this feature.

Android known issues unstable

Most helpful comment

Happy to inform you that I've found a workaround by using this app - ActiveGPS. To make it workable you should disable power saving for ActiveGPS.

All 16 comments

Maybe you test and report the current state?

Note that "screen off" is different from "in the background". The app will be in the background when another app is active. It will need a different approach to make recordings while the app is in the background (i.e. stopped).

If it is stopped (swiped out of the "recent apps" list) you can of course not track. But if you leave the app in the foreground and just turn the device off it works AFAIK. So maybe the documentation is wrong here.

I've changed my work device to Mi 9 powered by Android Pie (MIUI 10.2) with internal dual-band GNSS receiver. In this setup track is recorded only when the screen is on. Unfortunately this behavior makes the dual-band GNSS receiver almost useless. Looking for a solution or workaround, I found a similar issue with Osmand (resolved). I would be very grateful if track recording when the screen is off will be possible on new devices with internal GNSS reciver.

@yevhenmazur Thanks for pointing this out. Which OOMapper version were you refering to?
FTR I would like to add the link to https://github.com/osmandapp/Osmand/issues/5632.

Tested on OOMapper 0.8.4 and dev-20190609.3
Tomorrow I going to test it with external Bluetooth GNSS receiver.

dev-20190609.3 has target API level 28 so it will probably significantly increase our "obligations" on newer devices. This could be hard to solve. (We can move GPX tracking to a service, but I'm more concerned about the app being killed while you are taking photos.) At least, I do have an 8.1 test device.

Android 9 (API level 28) uses a rigid power management. With a foreground service, an app is considered to be in the active bucket.

In Android 8 (API level 26), background apps receive location updates less frequently, only a few times each hour. With a foreground service, an app is considered to be in the foreground.

Android 6 (API level 23) introduced Doze and App Standby modes which are activated (in some situations) when the screen is turned off. Again, a foreground service would be taken into consideration by Android when deciding if an app is idle. In addition, there is a configurable whitelist for apps which are allowed to ignore Android's battery optimizations.

So for Android 6 and later, you may already test if disabling Android's battery optimization for OpenOrienteering Mapper mitigates the issue. Just go to:
Settings > Battery > Battery Optimization.

TODO:

  • [ ] Add a foreground service
  • [ ] Guide the user to the battery optimization setting.

This deserves extra attention with regard to Google Play policies.

I did not notice the difference with the battery optimization turned off. This was one of the first things I did to find a solution or workaround.

@yevhenmazur Thanks for reporting. Sorry that this didn't help. I'll try to add the foreground service soon.

I have Samsung Galaxy Tab Active 2 (Android 8.1.0) for a month now. And it originaly also stopped recording when screen went asleep (Mapper 0.8.4). I did some adjustments and it now works also in the sleep mode. I assume the trick was. Screen lock type. None.
I also switched off: Floating icon. Pointer.

Android 9 (API level 28)

FWIW, I can help with testing as I have a Google smartphone with said Android version.

My assumptions were wrong. The real culprit, at least for me, seems to be internal x external GNSS receiver. If external OK. If internal bad - measurement each cca 10 minutes (will inspect gpx later).
Will try the Battery Optimization.

Happy to inform you that I've found a workaround by using this app - ActiveGPS. To make it workable you should disable power saving for ActiveGPS.

Where can I get new apk for testing?

I will create a new unstable release APK when #1296 is merged.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SwStef picture SwStef  路  6Comments

jan-gerard picture jan-gerard  路  7Comments

dl3sdo picture dl3sdo  路  5Comments

Symbian9 picture Symbian9  路  9Comments

yevhenmazur picture yevhenmazur  路  7Comments