Posts tagged with maps

Android Navigation Using Google Maps

March 30th, 2011

My app links to Google Maps navigation by sending the start and end points to Google Maps using ther following code.

String directions="http://maps.google.com/maps?saddr="+startlatitude+","+startlongitude+
"&daddr="+endLatitude+","+endLongitude;
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setData(Uri.parse(directions));

This works fine and launches Google Maps. However I had another intent that was launching without knowing the current location. I wanted Google Maps to get the location for me but couldn’t work out how to force Maps to use my location as the start point.

As it turns out the solution was obvious, if you dont send the start address parameter Maps assumes you mean from the current location so the code becomes this.

String directions="http://maps.google.com/maps?daddr="+endLatitude+","+endLongitude;
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setData(Uri.parse(directions));

This opens Google Maps with ‘My location’ listed as the start point so you have to then press the ‘Go’ button but saves me the effort of getting the location first.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Google Maps Navigation now in Denmark

June 9th, 2010

You can read the full story on Engadget or the Google page, but here’s a few screen shots taken from my HTC Desire.

If you don’t have the Android navigation app installed just download it from the market.

Google Maps Navigation

Google Maps Navigation

Google Maps Navigation

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Switch to our mobile site