Try this, much simpler than Haversine!
Location me = new Location("");
Location dest = new Location("");
me.setLatitude(myLat);
me.setLongitude(myLong);
dest.setLatitude(destLat);
dest.setLongitude(destLong);
float dist = me.distanceTo(dest);
More Related Contents:
- Is it possible to create turn-by-turn GPS navigation app on Android/iOS using Google Maps?
- want show google map as globe like google earth in my application
- Android Studio – Google map still blank on real Android device on release apk
- Implement page curl on android?
- How to draw free hand polygon in Google map V2 in Android?
- How to use multiple MapActivities/MapViews per Android application/process
- One Google Maps key for all developers?
- Replace default Android Maps API v2 Change MyLocation icon
- Android: How do I set the zoom level of map view to 1 km radius around my current location?
- How to get the current location in Google Maps Android API v2?
- How do I show a marker in Maps launched by geo URI Intent?
- How to draw road directions between two geocodes in android google map v2?
- Generating Google map Release API Key
- getLastKnownLocation() returns null [closed]
- Cannot resolve method ‘getSupportFragmentManager ( )’ inside Fragment
- Android getOrientation Azimuth gets polluted when phone is tilted
- Android – How to launch Google map intent in android app with certain location, zoom level and marker
- Android: Google Maps location with low battery usage
- Android Maps API v2 draw circle
- How can I create an Android application in Android Studio that uses the Google Maps Api v2?
- java.lang.NoClassDefFoundError:failed resolution of :Lorg/apache/http/ProtocolVersion
- Add Google Maps API V2 in a fragment
- How to center the camera so that marker is at the bottom of screen? (Google map api V2 Android)
- Google Map Android API v2 can’t display map in play store application
- Identify if point is in the polygon
- MarkerClick works but InfoWindowClick does not open ViewModel
- How can I handle map move end using Google Maps for Android V2?
- First launch of Activity with Google Maps is very slow
- Add an Image from url into custom InfoWindow google maps v2
- Show popup above map marker in MapView