Android Question Tracker example doesn't run when user puts device into sleep

When using the tracker example, is it possible to keep the GPS-locations changing when the user puts the device to sleep (using powerbutton to turn off screen).
Just tested it but when using the powerbutton the debugger shows:
B4X:
** Activity (main) Pause, UserClosed = false **

after that there is no logging of the GPS-change (I've added a log-line).
We're using it in a drivers app but also when the screen goes dark it should keep track and sending data.
 
Tested on a Xiaomi Mi9 pro then this doesn't occur (android 10)
Tested on a CAT then this doesn't occur (android 4)
Tested on a Samsung Galaxy A9 then this does occur (android 9)

then i ran out of phones :)
 
Upvote 0

Erel

Administrator
Staff member
Licensed User
Upvote 0
I've tested it with a clean download of:

The timer keeps coming back in de logging but the GPS_LocationChanged isn't being triggered any more after using the power button to set the screen dark. This is on a Samsung Galaxy A8. What I also noticed is that, when the screen is dark the GPS_LocationChanged isn't triggered. But when pressing the powerbutton, and you can see the lock-screen, then it is getting triggered.

The same application on a Xiaomi Mi9 works like a charm.
 
Last edited:
Upvote 0
Top