calculate Google Map Distance NS - Android Map

Android examples for Map:Google Map

Description

calculate Google Map Distance NS

Demo Code


//package com.java2s;
import android.location.Location;

public class Main {
    /**/*from   w  w w.ja  va 2 s  . c  o  m*/
     * @param start
     * @param destination
     * @return
     */
    public static double calculateGoogleNS(Location start,
            Location destination) {
        Location loc = new Location("loc");
        loc.setLatitude(destination.getLatitude());
        loc.setLongitude(start.getLongitude());
        return start.distanceTo(loc);
    }
}

Related Tutorials