to the point. I am using Google Maps Android Api v2 distanceBetween method to grab distance between user location and some point on the map as you can see here:
float[] distance = new float[1];
Location currentLocation = PECApplication.getInstance().getLocationClient().getLastLocation();
Location.distanceBetween(currentLocation.getLatitude(), currentLocation.getLongitude(), marker.getPosition().latitude, marker.getPosition().longitude, distance);
TextView distanceView = (TextView) infoWindow.findViewById(R.id.eventDistanceValue);
distanceView.setText(formatDistance(distance[0]));
The problem is that the result don't match the result I receive from google maps website. In one of the cases the distance of Google Maps Website was 31km and the result from distanceBetween method was 23,328 KM. Someone have a clue? Thanks alot.