android - Measure the distance between two locations by road -


how can measure distance between 2 location road in android application? wrote code measure distance in straight line, need code shortest distance road. should change in code it?

public double updatedistance(location location) {     float results[] = new float[3];     location.distancebetween(location.getlatitude(),             location.getlongitude(), mlatitude, mlongitude, results);     distance = results[0];     return distance; } 

use google maps api instead

https://developers.google.com/maps/documentation/distance-matrix/intro?hl=en

you can see too

google map api v2 - driving distance current location known locations


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -