Search code examples
javaandroidgps

Check if a Location is out of a Area radius


I have a Area with a Radius of 450 m. is there a way to check if a Location(Latitude,Longitude) is out of this Radius or not?

enter image description here


Solution

  • Use distanceBetween() to see if the two points are greater than 450m apart, using the center of your area as the starting point.