Good afternoon Erel, I have a problem with the GPS in the background after two minutes it stops working I have tried another version of Android (under 9) and there it works for up to an hour. your help please. Background Service.
I used the Mylocation.zip example that was in the forum but in my version of android 9 it stops within two minutes
just add an insert to the base to see the time in which it entered. but after a minute I didn't keep
Even though this is probably not causing a problem now, it is good practice to add parentheses to make sure the math is done properly so it doesn't try to add 10 to .Now THEN multiply the RESULT of that by TicksPerSecond:
B4X:
If DateTime.Now > LastUpdateTime + (10 * DateTime.TicksPerSecond) Then
Even though this is probably not causing a problem now, it is good practice to add parentheses to make sure the math is done properly so it doesn't try to add 10 to .Now THEN multiply the RESULT of that by TicksPerSecond:
B4X:
If DateTime.Now > LastUpdateTime + (10 * DateTime.TicksPerSecond) Then
Good afternoon Erel, I have a problem with the GPS in the background after two minutes it stops working I have tried another version of Android (under 9) and there it works for up to an hour.
Simple example of a foreground service that keeps the process running in the background. The current location is shown in the persistent notification. The app starts at boot and theoretically should run all the time. It also schedules itself to run with StartServiceAt. This can help in cases...
Simple example of a foreground service that keeps the process running in the background. The current location is shown in the persistent notification. The app starts at boot and theoretically should run all the time. It also schedules itself to run with StartServiceAt. This can help in cases...