我可以获取Android的Google地图应用的源代码吗?

时间:2011-09-10 18:17:08

标签: android google-maps

我在某处读到了所有默认的android应用程序,其中包含opensource。

如果是这样,我正在尝试查找Google地图代码。谁能告诉我怎么会找到它?

4 个答案:

答案 0 :(得分:35)

Nope

您可能希望在应用程序中使用Maps API

答案 1 :(得分:2)

虽然Android本身是开源的Googles propritary应用程序是明显的安全和知识产权原因的封闭源。

这些专有应用程序包括以下内容:

  • 地图
  • 导航
  • 的YouTube
  • 的GMail

如果您想在提供的状态下使用这些应用,可以使用意图触发它们。

每个应用程序都需要intent uri或extra参数中的参数,但是这些参数的例子很容易找到。

答案 2 :(得分:-2)

如果您在Eclipse中工作,请使用下载管理器下载这些插件:

它们可让您访问Android源平台和许多应用程序。

答案 3 :(得分:-2)

签入github可能是你找到了解决方案

https://github.com/googlemaps

你应该先安装这两个包 Google Play服务 Google Repository 然后尝试在布局中添加此片段

<fragment
    android:id="@+id/mapView"
    android:name="com.google.android.gms.maps.MapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

然后你应该添加这个方法来初始化地图

private void createMapView(){
    try {
    if(null == googleMap){
        googleMap = ((MapFragment) getFragmentManager().findFragmentById(
                R.id.mapView)).getMap();

        /**
         * If the map is still null after attempted initialisation,
         * show an error to the user
         */
        if(null == googleMap) {
            Toast.makeText(getApplicationContext(),
                    "Error creating map",Toast.LENGTH_SHORT).show();
        }
    }
} catch (NullPointerException exception){
    Log.e("mapApp", exception.toString());
}

}

https://github.com/glennsayers/AndroidMapsTutorial