5

In my direction class I have two geo points.One corresponds to current position and other is a fixed geo point.Current position will keeps changing.I need to draw route between these two points and need to change this line for a change in distance of 500m.

siraj
  • 461
  • 2
  • 6
  • 17

2 Answers2

18

I think best solution is called android internal map activity to show route between two geo points . Please refer below code.

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 called built in map activity and draw a route path between current and fixed latitude and longitude.

Chirag
  • 56,621
  • 29
  • 151
  • 198
  • Then siraj please go through this link . http://www.anddev.org/google_driving_directions_-_mapview_overlayed-t826.html – Chirag Nov 22 '11 at 06:02
1

@Siraj May be this link will help you to find how you can achieve your goal .you can use your start point and End point lat and long to draw path in your own map .use this link for Geocoding API click here

For Draw path refer this link for Draw Path

Herry
  • 7,037
  • 7
  • 50
  • 80