Android examples for android.location:Distance
Calculate distance between two points
public class Main{ public static float distance(float x, float y, float sx, float sy) { float dx = x - sx; float dy = y - sy; return (float) Math.sqrt(dx * dx + dy * dy); }/*from ww w .j av a 2 s . co m*/ }