calculate Google Map Distance - Android Map

Android examples for Map:Google Map

Description

calculate Google Map Distance

Demo Code


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

public class Main {
    /**//from  w  w w .  j  av  a 2 s.  co m
     * @param start
     * @param destination
     * @return
     */
    public static double calculateGoogleWO(Location start,
            Location destination) {
        Location loc = new Location("loc");
        loc.setLatitude(start.getLatitude());
        loc.setLongitude(destination.getLongitude());
        return start.distanceTo(loc);
    }
}

Related Tutorials