申请Android Maps API Key

要使用Android Maps API,首先需要申请一个API Key。
官方文件网址
http://developer.android.com/guide/topics/location/index.html
如何取得API Key
http://developer.android.com/guide/topics/location/geo/mapkey.html
 
 
首先,我们要找到SDK tools的debug.keystore文件
XP:C:/Documents and Settings/<User>/Local Settings/Application Data/Android/debug.keystore
Vista:C:/Users/<User>/AppData/Local/Android/debug.keystore
OS/Linux: ~/.android/debug.keystore
 
在Dos模式下输入如下指令获得MD5码:
keytool -list -alias androiddebugkey -keystore “文件路径” -storepass android -keypass android。
或者输入keytool -list -keystore debug.keystore,然后输入密码:android。
其中“文件路径”输入刚才的debug.keystore文件路径
 
获取MD5过程如下图:
 

最后,到申请API Key的网页输入MD5码
http://code.google.com/intl/zh-TW/android/maps-api-signup.html (台湾)
http://code.google.com/intl/zh-CN/android/maps-api-signup.html (大陆)
即可生成Key值
申请Android Maps API Key_第1张图片  
 
使用时,在代码中加入
android:apiKey=“申请到的Key值”
例:

l
<com.google.android.maps.MapView android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="0DM1wpkp6ed4RPRjwEGiKkZ443mb2SE-waDCb2g" />

 

 转载于:http://blog.sina.com.cn/s/blog_4c5f85000100h6pz.html并添加部分内容


你可能感兴趣的:(android,api,dos,XP,layout,tools)