jimburton / BigArrow

MIT License
1 stars 10 forks source link

Optimise location searches #5

Closed jimburton closed 11 years ago

jimburton commented 11 years ago

Currently, the Activities that use a LocationManager (all the PlaceSearchActivities) get updates when the location has changed by 50m or more, and at most once every 10 seconds. We can optimise this by setting the distance buffer on the LocationManager to a value that is relative to the LatLngBounds of the map. The minimum distance for notification should be relative to bounds, e.g. half. That way, if the map envelope is large (e.g. in an area with sparse places API data), location updates will only be needed when the user moves by, e.g., 500m. When the map envelope is small (e.g. on a city street with lots of nearby places) it would receive updates after moving, e.g., 20m.

AlmasB commented 11 years ago

now location gets updated everytime you move a quarter of the bounds and at least 5 min have passed since last update, however I suspect onLocationChanged() doesnt always get called when I expect it to. Although the search is now more optimised than it used to be I recommend a thorough testing of the new approach