[android-developers] Launch Google Maps app

2010-03-31 Thread oriharel
Hi,
I'm trying to launch Google maps from my application.
I'm using:

GeoPoint center = _mapView.getMapCenter();
Uri uri = Uri.parse(geo:+center.getLatitudeE6()
+,+center.getLongitudeE6());
Log.d(LOG_TAG, Launching Google Maps with Uri: (+uri+));
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);


I tested it with a map centered on somewhere in NYC, however Google
maps opens not centered there.
I followed Android Developer's site reference to use:
geo:latitude,longitude pattern.

the log that you see prints:
03-31 13:01:20.126: DEBUG/CarMapActivity(248): Launching Google Maps
with Uri: (geo:40763500,-73979305)

anyone knows what can be the problem?

thanks!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.


Re: [android-developers] Launch Google Maps app

2010-03-31 Thread Mark Murphy
oriharel wrote:
 Hi,
 I'm trying to launch Google maps from my application.
 I'm using:
 
 GeoPoint center = _mapView.getMapCenter();
 Uri uri = Uri.parse(geo:+center.getLatitudeE6()
 +,+center.getLongitudeE6());
 Log.d(LOG_TAG, Launching Google Maps with Uri: (+uri+));
 Intent intent = new Intent(Intent.ACTION_VIEW, uri);
 startActivity(intent);

The geo: Uri format does not take E6 latitude/longitude. It takes
regular decimal latitude/longitude.

 03-31 13:01:20.126: DEBUG/CarMapActivity(248): Launching Google Maps
 with Uri: (geo:40763500,-73979305)

That should be:

geo:40.763500,-73.979305

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android 2.x Programming Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using remove me as the subject.