heyred
heyred

Reputation: 2051

Android GPS navigation between 2 points

Can anyone point me in the direction of a tutorial on how to use GPS (Google maps) to navigate between 2 points in an Android app. I have searched for the last few hours and can only find tutorials on pinpointing current location.

What I need to do is show current position on map, and then navigation to a set destination on map. So e.g. you are at point A - navigate to point Z

EDIT: Sorry but I should have clarified. What I want to do is just have a button in the app that the user clicks. Once clicked, Google Maps app open and from here Google can do the rest. I don't need the map to be displayed in my app at all.

Upvotes: 2

Views: 5406

Answers (2)

tyczj
tyczj

Reputation: 73753

There is no easy way to do it, you will need to get the direction from a location API such as Google Directions API or Cloudmade to give you all the way points between your 2 points.

you then however have to plot the path and then handle the voice controls yourself

you can however use and Intent to launch the google navigation app in the google maps app and just have google maps do everything but that does not sound like what you want

Upvotes: 1

Geobits
Geobits

Reputation: 22342

You can use a VIEW intent using standard google maps parameters. If Google Maps is installed on the device, the user will be able to choose to open it using that or the default browser, etc.

Unfortunately, there's no way to do this directly with a geo: intent at this time. In any of my mapping applications, I've given up bothering with geo: because it's just not mature or standardized enough.

For a great list of url parameters to use(including "directions" mode), check out Everything You Never Wanted to Know About Google Maps' Parameters. I keep it bookmarked.

Upvotes: 0

Related Questions