You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently directly use the location reported by Android.
However, that location may not be equally accurate at all times.
Logic for handling accuracy changes and estimating the best current location would be a great addition.
You might expect the Location object that's contained in the most recent call to getLastLocation() to be the most accurate. However, because the accuracy of a location varies, the most recent value isn't necessarily the best. You should include logic for choosing which location to show based on several criteria. The set of criteria also varies, depending on the use cases of your app and results from field testing.
To validate the accuracy of a location that's returned from getLastLocation(), complete steps that include the following:
Check whether the location retrieved is significantly newer than the previously fetched location.
Check whether the accuracy claimed by the location is better or worse than that of the previous estimate.
Check the provider that's associated with the new location. Decide whether you trust this provider more than the one used in your app's cached location.
Possible Approaches
There are plenty of methods for approaching this issue, ranging from simple averaging to complex interpolations.
An accurate but fast and efficient method would be best.
The text was updated successfully, but these errors were encountered:
We currently directly use the location reported by Android.
However, that location may not be equally accurate at all times.
Logic for handling accuracy changes and estimating the best current location would be a great addition.
To quote the Android developer page on retrieving the current location:
Maintain a current best estimate
You might expect the
Location
object that's contained in the most recent call togetLastLocation()
to be the most accurate. However, because the accuracy of a location varies, the most recent value isn't necessarily the best. You should include logic for choosing which location to show based on several criteria. The set of criteria also varies, depending on the use cases of your app and results from field testing.To validate the accuracy of a location that's returned from
getLastLocation()
, complete steps that include the following:Possible Approaches
There are plenty of methods for approaching this issue, ranging from simple averaging to complex interpolations.
An accurate but fast and efficient method would be best.
The text was updated successfully, but these errors were encountered: