Google Directions API 2010

Tutorials that use the MapActivity. Many using GPS functionality.

Google Directions API 2010

Postby shepa006 » Tue Jun 08, 2010 6:11 am

Has anyone used the Google Directions API, http://code.google.com/apis/maps/documentation/webservices/index.html? I was told that this service can be used in Android but I'm not sure how... I was thinking maybe as an Intent or HTTP Request? I am very new to programming for Android so please... links to code and/or tutorials is very helpful! I need to be able to overlay navigation routes on my map in my app and unfortunately the com.google.googlenav package, used in the tutorial here post3452.html?hilit=Google%20Directions%20API#p3452, seems to have been dropped in the latest SDKs.

Thanks.
shepa006
Freshman
Freshman
 
Posts: 2
Joined: Fri Jun 04, 2010 9:03 pm

Top

Re: Google Directions API 2010

Postby kevindorson » Fri Jun 11, 2010 7:25 am

Hi Shepa, Even i've been looking for a similar solution. Did u get any help or support??? PLease share the same if you would have got it.
kevindorson
Developer
Developer
 
Posts: 44
Joined: Mon Mar 29, 2010 11:51 am

Re: Google Directions API 2010

Postby shepa006 » Fri Jun 11, 2010 3:38 pm

I'm still trying to find an answer. I've been emailing and posting on forums, but no one has replied with an answer or posted an updated tutorial (as far as I can tell). If I find an answer or get it working myself then I'll post the solution here.
shepa006
Freshman
Freshman
 
Posts: 2
Joined: Fri Jun 04, 2010 9:03 pm

Re: Google Directions API 2010

Postby kevindorson » Tue Jun 15, 2010 4:54 am

Hi Shepa, i have found the solution for the same!!!

Upon onClick of a button
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. button.setOnClickListener(new OnClickListener() {
  2.                                                                                                                                
  3.                                         public void onClick(View view) {
  4.  
  5.                                                
  6.  
  7.                                                         String directionsURL = "http://maps.google.com/maps?"
  8.                                                                 + "daddr="
  9.                                                                 + latitude + "," + longitude;
  10.                                                         //daddr is the destination address where u wnat to go,
  11. //automatically, in this case , starting addressbecomes your current location
  12. //if u want to add starting address also as a seperate GPS coordinate, then add saddr parameter before daddr
  13.  
  14. //Also, inplace of latitude and longitude Values, you can also input the address in text format also like //xyz,street1,sunnyvale
  15.                                                         Intent myIntent = new Intent(
  16.                                                                         android.content.Intent.ACTION_VIEW, Uri
  17.                                                                                         .parse(directionsURL));
  18.                                                         startActivity(myIntent);
  19.  
  20.                                                
  21.  
  22.                                         }
  23.                                 });
  24.  
  25. }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4







This shud take u to the google maps native apps wheer u can get the directions, bus route and timings and the navigation also.


Let me know icase you need more information!!!!
:) :) :) :) :)
kevindorson
Developer
Developer
 
Posts: 44
Joined: Mon Mar 29, 2010 11:51 am

Top

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests