I want to get the distance from A to B by latlng.When i run my app with the following code,it return a wrong result. Fx i tryed A( 31.172740,115.0081630) ,then B(30.6055980,
LatLng startLatLng = new LatLng(startLatitude, startLongitude);
LatLng endLatLng = new LatLng(endLatitude, endLongitude)
double distance = SphericalUtil.computeDistanceBetween(startLatLng, endLatLng);
also add
compile 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.maps.android:android-maps-utils:0.5+'
to your gradle dependencies
Distance in meters