See this illustration:
What I would like to know is:
- How to create an area (circle) when given a latitude and longitude and the distance (10 kilometers)
- How to check (calculate) if a latitude and longitude is either inside or outside the area
I would prefer if you can give me code example in Java or specifically for Android with Google Maps API V2
Have you gone through the new GeoFencing API. It should help you. Normal implementation takes a lot of time. This should help you implementing it easily.
see https://developer.android.com/reference/android/location/Location.html
If you mean by "How to create an area", that you want to draw the area on the map, you will find an example right in the map V2 reference doc for the class Circle.
For checking whether the distance between the center of the circle and your point is greater than 10 km I would suggest to use the static method Location.distanceBetween(...) as it avoids unnecessary object creations.
See also here (at the very end of the answer) for a code example in case the area is a polygon rather than a circle.
What you basically need, is the distance between to points on the map:
If you have already
Location
objects:Here is the interesting part of that API: https://developer.android.com/reference/android/location/Location.html