Android Client 10.1.2 Irregular location updates

virtualsalim 21 days ago

Hi,

I'm testing Traccar Client 10.1.2 on two Samsung Android phones. I need a fresh GPS position approximately every 60 seconds, including when stationary and with the screen locked.

Both phones are configured with High accuracy, 60-second interval, distance 0, stop detection off, and unrestricted battery access.

Initially, tracking works almost every minute, but after some time the intervals become irregular, sometimes reaching 5–10 minutes. The client logs confirm gaps between Location accepted events, while uploads generally succeed.

Wake lock didn't help.

I've read that Highest accuracy may improve reporting, but I need to stay around 1,440 reports per device per day.

I'm now testing Use system location with High accuracy.

Has anyone experienced this? Is there a recommended configuration for reliable 60-second tracking without using Highest accuracy?

Thanks,
Sal

Anton Tananaev 21 days ago

Stationary updates are expected to be around 10 minutes. That's a limitation of job scheduler on Android.

virtualsalim 21 days ago

Thanks Anton.

I have Stop Detection disabled, so I understood from the documentation that the client should remain in moving mode and use the configured 60-second interval instead of the stationary heartbeat.

Does the 10-minute Android scheduling limitation still apply in this configuration?

I am also seeing 5–10-minute gaps while driving and walking, not just when stationary.

Anton Tananaev 21 days ago

No, if you have stop detection disabled, then it should not switch to stationary state. Then the issue is just OS limiting updates for some reason.

virtualsalim 21 days ago

I tested Use system location with High accuracy, a 60-second interval, stop detection off and Wake lock on.

Unfortunately, it didn't help. During a 23-minute stationary test with the screen locked, the client recorded only six positions, with gaps of up to 10 minutes.

The log confirms AndroidLocationSource was started and Wake lock acquired. Uploads succeeded.

Is there a way to identify which Android restriction is preventing the regular location updates, perhaps through ADB logs or another diagnostic?

Thanks!

Anton Tananaev 21 days ago

Have you checked if you're actually receiving GPS locations during that time?

virtualsalim 21 days ago

Not independently. I've only checked Traccar's Location accepted logs and the server's position history.

What's the simplest way to check whether Android is actually obtaining GPS locations during those gaps? Would you recommend a separate GPS logging app or ADB?

Anton Tananaev 21 days ago

Check accuracy value in Traccar.

virtualsalim 21 days ago

I checked the accuracy values in the CSV for the 23-minute test.

The six positions had accuracy values of 28, 60, 38, 40, 42 and 11 metres.

Interestingly, the last position had 11 m accuracy despite arriving after a 10-minute gap.

Does that help narrow down the cause?

Anton Tananaev 21 days ago

All of those are probably not GPS locations with this low accuracy, so that would explain gaps.

virtualsalim 21 days ago

I ran another 20-minute test outdoors, with the phone stationary, screen locked and untouched.

Unfortunately, the result was similar: only 5 distinct positions, with gaps of 3, 6 and 10 minutes. Accuracy was 10–22 m.

Earlier, the same phone recorded every ~60 seconds for over an hour while stationary indoors, with accuracy around 12 m.

The battery was at 19–20% during this latest test, although power saving was off and Traccar has unrestricted battery access.

Could the low battery level explain this, or is there something else I should check to understand why Android has stopped delivering regular updates?

Anton Tananaev 21 days ago

Low battery could be the reason. Nobody really knows what logic vendors use for limiting background activity.

virtualsalim 21 days ago

I checked the Traccar Client SDK source on GitHub and noticed that when notification permission is denied, the app skips foreground-service startup.

I had disabled notifications on both Samsung phones. After enabling them again on one phone, tracking immediately returned to approximately 60-second intervals, even indoors with only 3% battery.

The test is still running, but does this sound like the likely cause?

If so, is there a way to keep the foreground service running while hiding or minimizing the tracking notification on the lock screen? We'd like to keep it as unobtrusive as possible.

Thanks!

Anton Tananaev 21 days ago

It's possible. Is there a reason you didn't approve notifications?

virtualsalim 21 days ago

The phones are company-owned and used by field supervisors. I want Traccar to run quietly in the background, with our own app as their main interface.

I disabled notifications to make Traccar less intrusive, without realizing this would affect its foreground service.

Tracking has now remained regular since enabling notifications again, so that seems to have been the problem.

Is there a way to hide the notification from the lock screen while keeping the foreground service running?