简体   繁体   中英

Android: Find Distance Between two geopoints

In Android, While Using distancebetween mathod it returns 0.0kms

And also Distance Between method too.. Please Help me... Thanks Forever..

I am struggling for my final Project

double distance

Location locationA = new Location(“point A”)

locationA.setLatitude(latA);

locationA.setLongitude(lngA);

Location locationB = new Location(“point B”);

locationB.setLatitude(latB);

LocationB.setLongitude(lngB);

distance = locationA.distanceTo(locationB);

http://developer.android.com/reference/android/location/Location.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM