Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logic for getting the best estimate phone location #14

Open
alxshine opened this issue Jul 7, 2020 · 0 comments
Open

Add logic for getting the best estimate phone location #14

alxshine opened this issue Jul 7, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@alxshine
Copy link
Collaborator

alxshine commented Jul 7, 2020

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 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.

@alxshine alxshine added enhancement New feature or request good first issue Good for newcomers labels Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant