I am writing a simple app that starts an Activity based on how close
my current location is from a destination.
One way to implement this is to calculate the distance between
locations using Location distanceTo method:
//Destination "dest" defined elsewhere
public void onLocationChanged(final Location here) {
double dist = here.distanceTo(dest);
if(dist < THRESHOLD) {
// do something ...
}
}
Another way is to use LocationManager.addProximityAlert.
Both work on my simple test. In practice, what are the pros/cons of
these approaches ?
Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---