0

In my android application , user will visit specific list of restaurants. He will go physically there and enter some information and then save the current location (latitude - longitude).

What I need now is to prevent duplicate restaurants. So when user save his current location , at that moment I need to check if there's an already registered restaurants within 1 km from his location.

The maximum number of restaurants will be 200.

I literally have no idea on how to implement such a thing.Any idea or suggestions will be appreciated!!

rav
  • 211
  • 5
  • 14
  • Possible duplicate of https://stackoverflow.com/questions/6981916/how-to-calculate-distance-between-two-locations-using-their-longitude-and-latitu – Abhay Paul Dec 06 '19 at 10:04
  • @AbhayPaul I found these posts , But I'm not having only two locations to compare I have my current location and all other registered locations. I want to know what is the best and more efficient way to do it. Cause i don't think that fetching all registered locations and looping through them one by one is a good idea – rav Dec 06 '19 at 12:31

0 Answers0