Android open map apps through intent
This Android code snippet will open up a dialog which allow you to pick a map app to show the address you passed in the intent.
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=replace+this+with+an+address")); startActivity(intent);
This Android code snippet will launch the google map with direction to the address you passed in.
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=replace+this+with+an+address")); startActivity(intent);
Passing in the latitude,longitude to the map app.
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:46.7170627,-71.2884537")); startActivity(intent);
Search within Codexpedia
Custom Search
Search the entire web
Custom Search
Related Posts