Turn-by-Turn Direction

Tutorials that use the MapActivity. Many using GPS functionality.

Turn-by-Turn Direction

Postby skylevelmedia » Sat May 21, 2011 7:08 pm

How can I get turn-by-turn directions in my app using MapView. I currently have an app that uses MapView to place two points on a map with an overlay. But I would also like to provide turn-by-turn direction just as google map does when it shows the route or map view.
skylevelmedia
Once Poster
Once Poster
 
Posts: 1
Joined: Sat May 21, 2011 2:44 am

Top

Re: Turn-by-Turn Direction

Postby chaitu45 » Mon Jul 11, 2011 8:17 pm

This fragment may help you. AFAIK turn by turn voice guided navigation is intended to be used from user's current location to destination. In the code below include the destination address in the place of "destAddr". destAddr in this case is a complete street address, not the GeoPoint. GeoPoints didnt work for me, I used Google's reverse geo coder to convert my geopoint into a street adress and then pass that with an intent like so:

Code: Select all
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + destAddr));
startActivity(i);


If you are only looking for directions displayed on a map then try reading this:
http://stackoverflow.com/questions/2662531/launching-google-maps-directions-via-an-intent-on-android

Let us know what works for you and how.
chaitu45
Experienced Developer
Experienced Developer
 
Posts: 65
Joined: Tue Sep 14, 2010 9:36 pm
Location: Cincinnati, Ohio

Re: Turn-by-Turn Direction

Postby abhilashpujari » Wed Jul 20, 2011 6:46 am

Hi,

I am able to check Point of Interest for the below Latitude and Longitude.


Working Link :

Searching library within 7500 meter :

https://maps.googleapis.com/maps/api/pl ... GRSjE7S8Vg


Searching bar within 7500 meter :

https://maps.googleapis.com/maps/api/pl ... GRSjE7S8Vg


Searching atm within 500 meter :

https://maps.googleapis.com/maps/api/pl ... GRSjE7S8Vg

Searching school within 500 meter :

https://maps.googleapis.com/maps/api/pl ... GRSjE7S8Vg


if I give latitude and longitude of any place in India, then it is not working, if you got any idea please inform.
abhilashpujari
Junior Developer
Junior Developer
 
Posts: 10
Joined: Wed Jul 06, 2011 5:42 am

Re: Turn-by-Turn Direction

Postby LPEspecial » Wed Aug 10, 2011 11:04 pm

Google maps navigation using a GeoPoint works with the following code fragment
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. double targetlat;
  2. double targetlong;
  3. GeoPoint gp;
  4. Intent intent;
  5. gp = new GeoPoint (..,..); // Get the Geopoint location which has to be used
  6. targetlat = gp.getLatitudeE6()/1E6;
  7. targetlong = gp.getLongitudeE6()/1E6;
  8. intent = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + targetlat+ "," + targetlong));
  9. intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  10. startActivity(intent);
  11.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
LPEspecial
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Aug 10, 2011 10:54 pm

Top

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests