Add utility code to make navigation easy

master
bspeice 2013-10-28 15:12:12 -04:00
parent 5ad1f3b075
commit a20b2e4789
1 changed files with 13 additions and 0 deletions

View File

@ -1,5 +1,8 @@
package com.uncc.gameday.parking;
import android.content.Intent;
import android.net.Uri;
public class ParkingCoordinate {
private double latitude;
private double longitude;
@ -24,6 +27,16 @@ public class ParkingCoordinate {
this.label = label;
}
public Uri getNavigationURI() {
// URI used to construct an intent for navigation
return Uri.parse("google.navigation:q=" + this.getLatitude() + "," + this.getLongitude());
}
public Intent getNavigationIntent() {
// Intent used to do navigation
return new Intent(Intent.ACTION_VIEW, this.getNavigationURI());
}
public ParkingCoordinate(double latitude, double longitude, String label) {
this.latitude = latitude;
this.longitude = longitude;