If you are in need of determining the distance between two geo coordinates on blackberry, use the following piece of code.
====
import javax.microedition.location.Coordinates;
private double difference( double currentLat, double currentLon, double startLat, double startLon )
{
Coordinates current = new Coordinates(currentLat, currentLon, 0);
Coordinates start = new Coordinates(startLat, startLon, 0);
float diffInMetres = current.distance(start);
return diffInMetres * 0.000621371192; //Convert into miles
}
====
Sunday, January 23, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment