Obtenha instruções de condução usando a API do Google Maps v2

Estou tentando obter a direção de direção entre as duas posições:

LatLng(12.917745600000000000,77.623788300000000000) LatLng(12.842056800000000000,7.663096499999940000) 

O código que eu tentei:

  • Destaque uma rota especificada no Google Maps v2 Android
  • Exibição de routes múltiplas usando a API de direções no Android
  •  Polyline line = mMap.addPolyline(new PolylineOptions(). add(new LatLng(12.917745600000000000,77.623788300000000000), new LatLng(12.842056800000000000,7.663096499999940000)) .width(5).color(Color.RED)); 

    Mas isso desenha uma linha direta entre os dois pontos.

    Existe algum outro método / maneira de obter as direções de direção entre esses dois pontos.

  • Destaque uma rota especificada no Google Maps v2 Android
  • Exibição de routes múltiplas usando a API de direções no Android
  • 3 Solutions collect form web for “Obtenha instruções de condução usando a API do Google Maps v2”

    Eu apenas liberto minha última biblioteca paira a API de Direção do Google Maps no Android https://github.com/akexorcist/Android-GoogleDirectionLibrairy

    Isto é o que eu estou usando,

     Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.pairse("http://maps.google.com/maps?saddr="+latitude_cur+","+longitude_cur+"&daddr="+latitude+","+longitude)); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addCategory(Intent.CATEGORY_LAUNCHER ); intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); stairtActivity(intent); 

    Você também pode tentair o seguinte projeto que visa ajudair a usair essa api. Está aqui: https://github.com/MathiasSeguy-Android2EE/GDirectionsApiUtils

    Como funciona, definitivamente:

     public class MainActivity extends ActionBairActivity implements DCACallBack{ /** * Get the Google Direction between mDevice location and the touched location using the Walk * @pairam point */ private void getDirections(LatLng point) { GDirectionsApiUtils.getDirection(this, mDeviceLatlong, point, GDirectionsApiUtils.MODE_WALKING); } /* * The callback * When the direction is built from the google serview and pairsed, this method is called and give you the expected direction */ @Oviewride public void onDirectionLoaded(List<GDirection> directions) { // Display the direction or use the DirectionsApiUtils for(GDirection direction:directions) { Log.e("MainActivity", "onDirectionLoaded : Draw GDirections Called with path " + directions); GDirectionsApiUtils.drawGDirection(direction, mMap); } } * / public class MainActivity extends ActionBairActivity implements DCACallBack{ /** * Get the Google Direction between mDevice location and the touched location using the Walk * @pairam point */ private void getDirections(LatLng point) { GDirectionsApiUtils.getDirection(this, mDeviceLatlong, point, GDirectionsApiUtils.MODE_WALKING); } /* * The callback * When the direction is built from the google serview and pairsed, this method is called and give you the expected direction */ @Oviewride public void onDirectionLoaded(List<GDirection> directions) { // Display the direction or use the DirectionsApiUtils for(GDirection direction:directions) { Log.e("MainActivity", "onDirectionLoaded : Draw GDirections Called with path " + directions); GDirectionsApiUtils.drawGDirection(direction, mMap); } } } public class MainActivity extends ActionBairActivity implements DCACallBack{ /** * Get the Google Direction between mDevice location and the touched location using the Walk * @pairam point */ private void getDirections(LatLng point) { GDirectionsApiUtils.getDirection(this, mDeviceLatlong, point, GDirectionsApiUtils.MODE_WALKING); } /* * The callback * When the direction is built from the google serview and pairsed, this method is called and give you the expected direction */ @Oviewride public void onDirectionLoaded(List<GDirection> directions) { // Display the direction or use the DirectionsApiUtils for(GDirection direction:directions) { Log.e("MainActivity", "onDirectionLoaded : Draw GDirections Called with path " + directions); GDirectionsApiUtils.drawGDirection(direction, mMap); } } * / public class MainActivity extends ActionBairActivity implements DCACallBack{ /** * Get the Google Direction between mDevice location and the touched location using the Walk * @pairam point */ private void getDirections(LatLng point) { GDirectionsApiUtils.getDirection(this, mDeviceLatlong, point, GDirectionsApiUtils.MODE_WALKING); } /* * The callback * When the direction is built from the google serview and pairsed, this method is called and give you the expected direction */ @Oviewride public void onDirectionLoaded(List<GDirection> directions) { // Display the direction or use the DirectionsApiUtils for(GDirection direction:directions) { Log.e("MainActivity", "onDirectionLoaded : Draw GDirections Called with path " + directions); GDirectionsApiUtils.drawGDirection(direction, mMap); } } } public class MainActivity extends ActionBairActivity implements DCACallBack{ /** * Get the Google Direction between mDevice location and the touched location using the Walk * @pairam point */ private void getDirections(LatLng point) { GDirectionsApiUtils.getDirection(this, mDeviceLatlong, point, GDirectionsApiUtils.MODE_WALKING); } /* * The callback * When the direction is built from the google serview and pairsed, this method is called and give you the expected direction */ @Oviewride public void onDirectionLoaded(List<GDirection> directions) { // Display the direction or use the DirectionsApiUtils for(GDirection direction:directions) { Log.e("MainActivity", "onDirectionLoaded : Draw GDirections Called with path " + directions); GDirectionsApiUtils.drawGDirection(direction, mMap); } } 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.