You can give a minimum interval between the location manager and the wait time between calls to this method, but it doesn’t quite remind that the interval is 100% of the time (see the description of LocationManager.requestLocationUpdates () ). Maybe shorter, maybe more - because, for example, it can be cloudy and the GPS chip will not be able to receive location updates as regularly as you would like.
There is no right way to overcome this - location services will always have flaws. Each location-oriented application used to “freeze” with a marker from time to time because the gps chip lost the fix for a moment.
The only thing you can do to smooth it a bit is to remember the speed of the movement, and if gps loses its correction, give fake marker map updates based on the assumption that the user is moving in the same direction at the same speed as they were, when gps had a fix. But this only makes sense so that 2-5 will skip real updates (just to smooth out cases where the fix is lost within a few seconds).
UPD To do this, you can implement a view of the proxy server location listener, which will update your token, strictly observing the intervals you specify, for example. every 200 ms and do it based on the saved location. And the stored location can be asynchronously updated by the real location receiver. Location objects have a correction time that provided the data (see the getTime () method ), you can use this to determine if you should “predict” the next marker movement or location is old enough to refuse and notify the user that that gps doesn't know where they are :)
source share