1.在命令行里用keytool命令生成一个MD5 certificate fingerprint 

2.注册Maps API Key

打开http://code.google. com/android/maps-api-signup.html  

在这个页面输入你的MD5 certificate fingerprint就可以获取Maps API Key

3.在eclipse中创建一个名字为Map的android工程。因为我们要调用地图API,所以在选择Build Target的时候一定要选择Google APIs。 

    <com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width
="fill_parent"
android:layout_height
="fill_parent"
android:apiKey
="0kjxD**********************2aw"
/>

4.修改AndroidManifest.xml

<uses-library android:name="com.google.android.maps"/>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
创建一个继承自MapActivity的Activity,实现未实现的方法
        MapView map = (MapView) this.findViewById(R.id.mapview);
map.setBuiltInZoomControls(true);
这样我们就可以看到一个基本的地图了

 

 


 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-08-01
  • 2021-05-04
  • 2022-02-06
猜你喜欢
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2021-12-23
  • 2021-11-26
相关资源
相似解决方案