How do I create a pair of longitude and latitudes to show a 2 mile radius of a particular longitude and latitude? in Java Android

StackOverflow https://stackoverflow.com/questions/21973500

Question

Out of my depth a little :-) How do I create a pair of longitude and latitudes to create a polygon showing a 2 mile radius of a particular longitude and latitude? in Java Android. I know how to find your current longitude and latitude but I just can't figure out the above.

My code so far is below:

LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); 
Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
double longitude = location.getLongitude();
double latitude = location.getLatitude();

No correct solution

OTHER TIPS

You can create the pair using LatLng.

        LatLng origin = new LatLng(my_latitude,my_longitude);

For creating a radius you can use Genofencing technique.

https://developer.android.com/training/location/geofencing.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top