The first step, you put the packaget for google maps
1 | private String PACKAGET_MAPS= "com.google.android.apps.maps" ; |
The seconds step, you put query for to search the address.
1 |
The third step, you put intent
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | if (Utils.isPackageInstalled(PACKAGET_MAPS, getApplicationContext())) { StringBuilder stringBuilder = new StringBuilder(); //query of google maps stringBuilder.append(HTTP_MAPS); //String with your address stringBuilder.append(separtorWithPlus( "yourAddress" )); stringBuilder.append( ",+" ); //string of City stringBuilder.append((separtorWithPlus( "City" ))); //intent with Uri which has query with address and city intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(stringBuilder.toString())); startActivity(intent); } else { mShowMessage.showAlert(getResources().getString( R.string.string_google_maps_uninstall)); } |