如何在android中获取谷歌地图apikey [英] How to get google map apikey in android

查看:50
本文介绍了如何在android中获取谷歌地图apikey的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当时正在做谷歌地图.我想在我的活动中显示地图.我成功地显示了地图视图.但我无法显示地图,我认为我有错误的 api 密钥,所以我怎样才能获得谷歌地图的 api 密钥.我创建了密钥库和所有程序,但我不知道如何从这个密钥库中获取 api 密钥.

Hi At that time working on google map. I want to display map in my activity. I successfully display the map view. But i cant show the map i think i have wrong api key so how can i get api key of google map. I create the keystore and all procedure but i didn't have idea how to get api key from this keystore.

我还在清单文件中授予所有权限,并添加了谷歌地图库,但我也无法显示 map.in 活动还扩展了 mapactivity 并在 xml 中编写了来自地图的代码.

I also give the all permission in manifest file and also add the google map library than also i cant show the map.in activity also extends mapactivity and also write code fro map in xml.

如果有人知道请告诉我.

If anyone knows about that please tell me.

推荐答案

如果您已经拥有密钥,请获取以下链接并将指纹与您的 android 项目包名称一起添加

If you already have the key got the link below and add the fingerprint along with your android project package name

您还需要登录您的 Google 帐户

You also need to login to your google account

https://code.google.com/apis/console

点击创建新密钥.添加指纹以及您的 android 项目包名称.

Click on create new key. Add the fingerprint along with your android project package name.

上面可以看到api key

You can see the api key above

从服务选项卡启用 google map api v2.

Enable google map api v2 from services tab.

然后在应用程序标签下的清单文件中

Then in manifest file under application tag

 <meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my key"/>

这篇关于如何在android中获取谷歌地图apikey的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆