| hai's profile★ Starfish^-^ ★ PhotosBlogLists | Help |
|
06/11/2009 在Android中使用Map需要注意的技巧一、申请获得Map API的密钥 申请APIkey的时候,类似命令如下: 生成页面:http://code.google.com/android/maps-api-signup.html 二、Apikey放在正确的位置 1、XML布局文件中 <view android:id="@+id/mv" 2、java中 mMapView = new MapView(this, "01Yu9W3X3vbpYT3x33chPxxx7U1Z6jy8WYZXNFA"); 三、记得导入uses-library 使用的时候需要在manifest中的application节点下加入 <uses-library android:name="com.google.android.maps" />
四、需要给予一定的权限 因为要使用GoogleMAP的service,所以需要 如果需要GPS等应用,还需要 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission> 五、Activity需要继承自MapActivity 类似如下代码; package com.iceskysl.showmap; TrackbacksThe trackback URL for this entry is: http://xinhai78.spaces.live.com/blog/cns!D593B15501500E8D!4396.trak Weblogs that reference this entry
|
|
|