Skip to content

Add logic for getting the best estimate phone location #14

Description

@alxshine

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions