1

I want to show a location on a map based on latitude and longitude coordinates. When I press a button I want to send the coordinates to Google Maps (or other app) and pinpoint that location. Any ideas of how I can achieve that?

Sam
  • 86,580
  • 20
  • 181
  • 179
Roman Marius
  • 456
  • 3
  • 9
  • 21

3 Answers3

2

Here is the nice example:

http://mobiforge.com/developing/story/using-google-maps-android

http://saigeethamn.blogspot.in/2009/10/google-maps-on-android-android.html

Hope this will helps you..

Lokesh
  • 5,180
  • 4
  • 27
  • 42
1

If you want to animate to a specific point on a google map you need to define a MapView. Then create a MapController and animate to a specific GeoPoint:

MapController mapController = mapView.getController();

double lat = latitude * 1e6;
double lon = longitude * 1e6;

GeoPoint startpoint = new GeoPoint((int) lat, (int) lon);
mapController.animateTo(startpoint);

Try this tutorial :MapView Tutorial

fabzy
  • 353
  • 3
  • 10
1

I've found a simple solution. I start the google maps app via an intent

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
                        Uri.parse("http://maps.google.com/maps?q=" + serviceActivity.Latitude.toString() + "," + serviceActivity.Longitude.toString()));
                        startActivity(intent);
Roman Marius
  • 456
  • 3
  • 9
  • 21