0

I would like to know if i can link my application with a app like google maps? For example If i create a button and onClick I go to Google maps app.So is there a way i can direct the onClick event of the button directly to the maps?If so how do I do it?

  • 1
    Have you checked the answers listed here? http://stackoverflow.com/questions/2662531/launching-google-maps-directions-via-an-intent-on-android – Patrick D Mar 19 '13 at 13:45
  • see this if it helps http://stackoverflow.com/questions/6205827/how-to-open-standard-google-map-application-from-my-application – Seif sammain Mar 19 '13 at 13:54

3 Answers3

1

You can do it with intents, if you want to open google maps from your app, you can do it with this code:

String uri = "geo:"+ latitude + "," + longitude;
Intent myMapIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(myMapIntent);

You can find some useful info about that in the related Android Documentation

The Good Giant
  • 1,740
  • 2
  • 19
  • 35
0

You can use

geo:latitude,longitude
geo:latitude,longitude?z=zoom
geo:0,0?q=my+street+address
geo:0,0?q=business+near+city

From the Android Developer guide

Matt Busche
  • 14,216
  • 5
  • 36
  • 61
0
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr="+mylocation));
startActivity(intent);
Furqi
  • 2,403
  • 1
  • 26
  • 32