/ Published in: Java
Yes, I realize that this won't work with j2me, but RIM has implemented some good helper classes to make this calculation much easier.
This calculation uses the Haversine formula.
This calculation uses the Haversine formula.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public double calculateDistance(double lat1, double lon1, double lat2, double lon2) { try{ double R = 6371; // km double d = R * c; return d; e.printStackTrace(); } return 0; }