Search code examples
androidgoogle-mapsgoogle-street-view

How to get street directions in google map


I want to display street directions from my current location to particular known location(latitude and longitude), how to do it using google map?


Solution

  • you can do that till android 1.6, they have removed the street directions after those versions.

    Use the below code to get the activity in higher than android 1.6 versions. Hope this helps you.

    final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?" +"saddr="+sourcelatitudeString+","+sourcelongitudeString+"&daddr="+sourcelatString+","+sourcelongString)); intent.setClassName( "com.google.android.apps.maps", "com.google.android.maps.MapsActivity"); startActivity(intent);