views:

224

answers:

3

Hey guys, I just wanted to know wether it is posssible to pass geocoords to the google maps app bis intents or something similar.

I wrote an app for displaying route, coords and so on by myself, but wouldn't it be more elegant to ask google maps itself for displaying this?

I don't know if this is possible, but maybe, one of you can answer this question.

IF THIS IS POSSIBLE, is it also possible to ask google maps to calculate the route by my CURRENT POSITION?

It would be great if one of you can show me a skeleton/dummy code. I have no idea how the intents would have to look like.

Nice greetings, Poeschlorn

+2  A: 

IF THIS IS POSSIBLE, is it also possible to ask google maps to calculate the route by my CURRENT POSITION?

No. The only documented Intents simply open a map on a point. There are no documented Intents at this time to launch straight into the navigation portion of the app.

Sorry!

CommonsWare
tanks for the answer, mh...would have been a nice feature ;-)
poeschlorn
+2  A: 

The documentation on Google Intents is here: http://developer.android.com/intl/fr/guide/appendix/g-app-intents.html

Unfortunately, it is (to my knowledge) currently limited to simply displaying a location, not a route. The user could then use that location to plot their own route, though.

Daniel Lew
thx for the link, I'm going to look at it and show wether I can use parts of it :)
poeschlorn
+1  A: 

There is a way, but you would need to get the coordinates of your current location by yourself (setting up a location listener). Once you have your location and your destination coordinates, fire this intent (this will let the user choose between Google Maps or Browser):

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345"));
startActivity(intent);
janfsd
hey, thx that could maybe be helpful :)
poeschlorn