我正在遵循谷歌地图Android API v2的示例代码来开发一个应用程序。但是当启动设备时,它告诉我Google Maps App is missing
(如果我安装谷歌地图应用程序,它可以工作)
但是我的设备上有其他使用谷歌地图的应用程序,没有要求安装谷歌地图应用程序。
我怎么能建立一个谷歌地图供电的应用程序没有谷歌地图安装在设备上?
感谢更新:我发现了这篇文章:
http://discgolfsoftware.wordpress.com/2012/12/09/check-if-google-maps-are-installed-on-android-if-not-direct-user-to-the-play-store/你还必须确保用户安装了谷歌地图应用程序。
看看我写的关于如何在应用程序中集成Google Map API V2
的博客文章:
Google Map API V2
处理你正在尝试做的事情是你可能运行以下意图:
Intent navigation = new Intent(Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?saddr=" +
String.valueOf(AppObj.getInstance().currentUserLocation.getLatitude())+","+
String.valueOf(AppObj.getInstance().currentUserLocation.getLongitude())+"&daddr="+
String.valueOf(task.getLatitude()) +","+ String.valueOf(task.getLongtitude())));
navigation.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(navigation);
但是这个动作将尝试启动原生google地图应用程序