I am having issues with passing a longitude and latitude to the google directions api (http://code.google.com/apis/maps/documentation/directions/) can anyone tell me what i am doing wrong, i am always getting no results but if i use address its fine
JSONObject jsonLocation = JSONfunctions.getJSONfromURL("http://maps.googleapis.com/maps/api/directions/json?origin=" + currentLongitude + "," + currentLatitude + "&destination=" + longitude + "," + longitude +"&sensor=true®ion=gb");
Thanks
Use this Code
Intent intent = new Intent(
android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr="+ latitude + "," + Longitude+ "&daddr="+latitudeDb+","+longitudeDb+""));
intent.setClassName("com.google.android.apps.maps",
"com.google.android.maps.MapsActivity");
startActivity(intent);