Android Google Map教程

Android Google Map教程

ID:37151753

大小:418.54 KB

页数:7页

时间:2019-05-19

Android Google Map教程_第1页
Android Google Map教程_第2页
Android Google Map教程_第3页
Android Google Map教程_第4页
Android Google Map教程_第5页
资源描述:

《Android Google Map教程》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、AndroidGoogleMap教程获得GoogleMapAPIKey:使用GoogleMapAPI前,必须先生成GoogleMapAPIKEY.生成GoogleMapAPIKey要使用两种工具:JDK的keytool和androiddebug模式下的keystore密钥库。JDK的keytool一般位于%JAVA_HOME%/bin目录下,例如:windows下在C:programfilesJavajdk1.6.0_26bin下androiddebug模式下的keystore密钥库位于C:usersyang.android目录下(yang是电脑用户名)。第一步:通过命

2、名提示符进入JDK的keytool所在目录第二步:输入命令生成MDK5Key命令格式:keytool–list–aliasandroiddebugkey–keystoreC:usersyang.androiddebug.keystore–storepassandroid–keypassandroid注意:下划线部分是androiddebug模式下的keystore密钥库的地址第三步:到GoogleMapAPI的主页去申请GoogleMapAPIKEY。 http://code.google.com/android/maps-api-signup.html页面,在其中的MD5f

3、ingerprint一栏中输入刚才生成的MD5密纹如果你是第一次使用GoogleMapAPI(即你还没有Google账号)你要按照提示申请一个账号。第四步:使用GoogleMapAPIKEY。1,创建一个工程,创建工程时“BuildTarget”要选择“GoogleAPIs”2,编写界面布局文件。-

4、orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent">注意:下面一段代码就是生成GoogleMapAPIKEY时产生的代码,重点是android:apikey 

5、android:apiKey="0uD--pAESYopaXd6ydGOuW5VpuY0Os7B4rPfg6Q"/>  3,MainActivity代码packagecom.g

6、oogle_map;importandroid.os.Bundle;importandroid.widget.LinearLayout;importandroid.widget.ZoomControls;importcom.google.android.maps.MapActivity;importcom.google.android.maps.MapView;publicclassMainActivityextendsMapActivity{LinearLayoutlinearLayout;MapViewmapView;ZoomControlsmZoom;@Overridepubl

7、icvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.main);linearLayout=(LinearLayout)findViewById(R.id.zoomview);mapView=(MapView)findViewById(R.id.mapview);mZoom=(ZoomControls)mapVi

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。