0

I am building a Android app using the Google Maps Android API v2.

I have a database of lat/long that Im trying to search and display, either by radius(in miles) and/or key-word based on my current location.

What would be the best way to approach this problem?

Thank you in advance.

sonnyo
  • 3
  • 1

1 Answers1

1

How I would approach it:

  1. Get the users location in lat/long
  2. User the haversine formula to compute the distance to points already in your database.
  3. Filter out the points that meet your threshold criterea (less than 5 miles for example)
  4. Within the GoogleMaps class, look at the addMarker() method. Use this to add your filtered database lat/long to the map.

A similar approach with keywords, you filter by keyword and not haversine distance.

R Ghosh
  • 612
  • 1
  • 4
  • 9