Making a Location object in Android with latitude and longitude values -


i have program in latitude , longitude values of location stored in database, download.

i want distance between these coordinates, , current location.

the location class has simple method find distance between 2 location objects, figured i'd make location object coordinates, call method.

is there easy way this? also, if there's reliable, simple equation won't clutter things much, work too. thanks.

(android.location.location)

assuming have location object current location.

location targetlocation = new location("");//provider name unnecessary targetlocation.setlatitude(0.0d);//your coords of course targetlocation.setlongitude(0.0d);  float distanceinmeters =  targetlocation.distanceto(mylocation); 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -