Android.Locations.Location.DistanceBetween Method
Computes the approximate distance in meters between two locations, and optionally the initial and final bearings of the shortest path between them.

Syntax

[Android.Runtime.Register("distanceBetween", "(DDDD[F)V", "")]
public static void DistanceBetween (double startLatitude, double startLongitude, double endLatitude, double endLongitude, float[] results)

Parameters

startLatitude
the starting latitude
startLongitude
the starting longitude
endLatitude
the ending latitude
endLongitude
the ending longitude
results
an array of floats to hold the results

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif results is null or has length

Remarks

Computes the approximate distance in meters between two locations, and optionally the initial and final bearings of the shortest path between them. Distance and bearing are defined using the WGS84 ellipsoid.

The computed distance is stored in results[0]. If results has length 2 or greater, the initial bearing is stored in results[1]. If results has length 3 or greater, the final bearing is stored in results[2].

[Android Documentation]

Requirements

Namespace: Android.Locations
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1