0

I have a function that return the distance between 2 locations

This is my function

  public static float GetDistance(Location locationA,  Location locationB ){
        float distance = locationA.distanceTo(locationB);
        return  distance;
    }

The float result what does it mean? air distance in kilometers?

I get 1.1 or 1.9 what does this result mean

Thanks

24sharon
  • 1,859
  • 7
  • 40
  • 65
  • [Look this](https://developer.android.com/reference/android/location/Location) Returns the approximate distance in meters between this location and the given location. – mhr Jan 14 '21 at 09:52

1 Answers1

0

I think that can help you : Calculating distance between two geographic locations

Returns the approximate distance in meters between this location and the given location. Distance is defined using the WGS84 ellipsoid.