2

Have been experiencing GPS issues while testing on Samsung J3 (SM-J320V w/ Android 6.0.1). I am using an AlarmManager in combination with the FusedLocationAPI (GPS and WiFi on) to schedule location being sent to our server in regular 30 second to 1 min intervals. Since testing on this phone, I have noticed that while the device is in the background, and phone is in transit, the GPS will return the same point continuously for minutes at a time. The GPS point corrects itself when the device exits the background and is resumed. I'm inclined to believe that this behavior has something to do with Doze mode introduced in Android 6 but am not sure. Has anyone experienced something like this before?

Potato
  • 121
  • 3
  • 6
  • In case anyone is still interested in this issue, I seem to have found a way to mitigate the problem. It looks like it has less to do with Doze and more to do with location caching within the Fused Location API. I found that the first location value returned by Fused tends to be heavily cached (and therefore the first value you receive could well be a few minutes old). I was able to get a more accurate location when I waited for the onLocationChanged event to fire a few times before accepting the value as permissible to be sent to our servers. – Potato Dec 30 '16 at 04:37

0 Answers0