Skip to content

Instantly share code, notes, and snippets.

@zurche
Created June 6, 2016 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zurche/739c8ab93f58daf58af1bd035f728bb0 to your computer and use it in GitHub Desktop.
Save zurche/739c8ab93f58daf58af1bd035f728bb0 to your computer and use it in GitHub Desktop.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Point buenosAiresObeliscoPoint =
new Point((float) -34.6037389, (float) -58.3815704);
Point nycStatueOfLibertyPoint =
new Point((float) 40.6892494, (float) -74.0445004);
float distanceBetweenPoints = LatLonDistanceCalculator.calculateDistance(
buenosAiresObeliscoPoint,
nycStatueOfLibertyPoint);
TextView kilometersLabel = (TextView) findViewById(R.id.kilometers_label);
kilometersLabel.setText("Between the Obelisco and the Statue of Liberty there are: \n" + distanceBetweenPoints + "KM");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment