open google maps through intent for specific location in android

I have not tested this but you could try :

First method:

String uri = String.format(Locale.ENGLISH, "geo:%f,%f", latitude, longitude);
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
context.startActivity(intent);

EDIT:
This might not work with Google maps 7,0

hence you could change the uri to :

Second option:

String geoUri = "http://maps.google.com/maps?q=loc:" + lat + "," + lng + " (" + mTitle + ")";

where mTitle is the name of the location.

Third option:

geo:0,0?q=my+street+address

Fourth option:

String map = "http://maps.google.co.in/maps?q=" + yourAddress;

Hope that works and helps :D..

Leave a Comment