When I'm using the LocationManager on my phone, for almost all the Nexus 5 test devices the LocationManager detects the same location a couple of times every minute (I'm listening for the location every 60 seconds). To be clear the code I'm actually using:
mLocationManager.requestLocationUpdates(60*1000,
0,
criteria),
mLocationUpdateListener, Looper.getMainLooper());
the criteria is set from the server and only defines the desired accuracy (Criteria.ACCURACY_COARSE or Criteria.ACCURACY_FINE).
So for my other test devices (Nexus 4 and a Samsung S3) I have no problem with the location manager. It always delivers a new position every 60 seconds. But the Nexus 5 devices seem to cache the position at some point, so that I send the exact same location 5 times to the server even though I'm already a few 100 meter away from that location.
Does anybody have a clue what could be the problem? If you're interested, I could also append the code for mLocationUpdateListener, but it just sends the location to the server.
Edit: the location is always obtained in a background service. I could overcome this problem by opening Google Maps in the foreground. But of course that can not be the solution to my problem.
Edit solution: It seems like somehow the Play Services didn't work on all 6 Nexus 5 test devices. After restarting all devices, I couldn't reproduce that weird behavior anymore...
Edit 2: and again I stumble upon this behavior and it keeps appearing even though I restart the phones...