google地图开发(Google Maps Android API V2 的相关问题解决)

近日用google maps android 开发的时候,遇到了“地图显示不出,只显示方格虚线”的问题,Logcat显示错误:”Couldn't get connection factory client“。

但是不科学啊,我都是按照google网站上面的进行的啊,于是找了很多资料也没办法解决,发现很多人跟我遇到了同样的问题。

哈哈,历经一天半,终于让我找到了,具体过程参照 https://developers.google.com/maps/documentation/android/start。

下面依据这个网站的进行一定的扩充吧。


1.通过Android SDK Manager安装 Extras下的 Google Play services SDK。

如果安装过慢,参照 http://jingyan.baidu.com/article/b0b63dbfd0948c4a483070ea.html


2.创建一个 google-play-services_lib project 项目 (参照https://developers.google.com/maps/documentation/android/intro#sample_code)


2.1.Select File > Import > Android > Existing Android Code Into Workspace and click Next.
2.2.Select Browse, enter <android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib, and click Open.(例如我的路径是D:\adt-bundle-windows-x86_64-20140321\adt-bundle-windows-x86_64-20140321\sdk\extras\google\google_play_services\libproject )
2.3.Select Copy projects into workspace and click Finish.
2.4.Mark Google Play services as a library: Right-click the google-play-services_lib project, and choose Properties > Android. Tick the Is Library option.


3.在自己的项目那里添加对这个库的引用

右键自己的项目,选Properties,选Android,在Library里面Add刚才的google-play-services_lib项目


4.在google上面创建项目 申请v2 key。https://code.google.com/apis/console/

4.1.创建一个项目,名字无所谓,当然最好和你现在的项目一致咯。

4.2.点左方的APIs & auth,点API 在Google Maps Android API V2那一栏开启(点右方的OFF就开启了)。

4.3.点credential,创建一个key,输入"SHA1;包名" ,sha1通过eclipse->windows->preferences->Android->Build获得。


5.按照https://developers.google.com/maps/documentation/android/start 在你项目的AndroidManifest.xml里面添加一些内容,我就不多加赘述了。


转载请注明出处 : http://blog.csdn.net/qq454822252/article/details/32339539

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值