I'm trying to get the path between two geo points on my android app, i don't need any driving directions - just path. What I've already found myself is to draw the straight line between two geopoints (http://djsolid.net/blog/android---draw-a-path-array-of-points-in-mapview). Is it possible to get the actual path? I mean path which I can really walk, road path - not just straight line between two geopoints without parsing the google maps web URL ?
Asked
Active
Viewed 810 times
0
-
Yes and answers are here on SO already – Anders Metnik Sep 11 '12 at 07:44
-
They are only WITH parsing url – pawel Sep 11 '12 at 07:47
-
http://stackoverflow.com/questions/4408671/android-draw-route-on-a-mapview-with-twoo-poi-s – Anders Metnik Sep 11 '12 at 07:47
-
and tell me, that you can't see url parsing in this code :D – pawel Sep 11 '12 at 07:51
-
without parsing API URl i thing not possible to draw path on maps. have no idea about URl parsing draw path . – ckpatel Sep 11 '12 at 11:35
1 Answers
0
I think the best solution is called android internal map activity to show route between two geo points. Please refer to the code below:
String uri = "http://maps.google.com/maps?saddr=" + currentLatitude+","+currentLongitude+"&daddr="+fixedLatitude+","+fixedLongitude;
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(intent);
It's called built in map activity and draws a route path between current and fixed latitude
and longitude
.

Yurii
- 4,811
- 7
- 32
- 41