Tulisan ini mirip seperti tulisan sebelumnya. Menentukan jarak antara dua titik kordinat di GPS. Hanya saja ini menggunakan fungsi bawaan android. Jadi lebih memudahkan. Langsung saja 🙂

1
2
3
4
5
6
7
8
9
10
11
12
13
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);
Reblog this post [with Zemanta]

Tulisan Lain   How To : Import Project Gradle di Eclipse untuk Android

By alfach

Leave a Reply

Your email address will not be published. Required fields are marked *