问题描述
即时通讯使用的谷歌地图V2创造了一个Android的简单的应用程序。
im creating a simple app for android using Google Maps v2.
我觉得我做错了什么事在获得API密钥...
I think i did something wrong in getting the api-key ...
我也跟着教程http://mobile.tutsplus.com/tutorials/android/android-sdk-working-with-google-maps-application-setup/\"
一切正常,但在我的情况下,地图犯规露面(...)
It worked properly, but in my case the map doesnt show up (...)
我创建了一个包,如com.mycustommap和API控制台中添加?键,com.mycustommap是正确的。
I created a package like "com.mycustommap" and added on Api Console "key;com.mycustommap" is that right?
还有即时通讯上的Galaxy Note 2上运行,并创建Eclipse的项目。
Also im running it on a Galaxy Note 2 and creating the project on Eclipse.
感谢您的帮助。
推荐答案
如果你正在开发Windows上转到
If you are developing on Windows go to
C:\\用户\\ YOUR_USER \\
目录,按住移
键,右键点击 .android
文件夹并选择在这里打开命令窗口
C:\Users\YOUR_USER\
directory, hold down the Shift
key, right click on the .android
folder and select Open command window here
然后键入的keytool -list -v -keystore debug.keystore
,按下回车键当问密码,并复制你的SHA1指纹。
Then type keytool -list -v -keystore debug.keystore
, hit enter when asked for password and copy your SHA1 fingerprint.
然后打开你的浏览器的https://$c$c.google.com/apis/console/
到 API访问权限
,然后点击创建新的Android键
Then open your browser to https://code.google.com/apis/console/
go to API access
and click on Create new Android key
然后输入有 SHA1_KEY; com.mycustommap
你应该输入类似结果 45:B5:E4:6F:36:AD:0A:98:94:B4:02:66:2B:12:17:F2:56:26:A0:E0; com。示例
Then enter there SHA1_KEY;com.mycustommap
you should enter something like45:B5:E4:6F:36:AD:0A:98:94:B4:02:66:2B:12:17:F2:56:26:A0:E0;com.example
您包的名称应与你在你的的AndroidManifest.xml
在
Your package name should match what you have in your AndroidManifest.xml
in
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycustommap" <== YOUR PACKAGE NAME
...
然后在你的的AndroidManifest.xml
你必须有个以下
<permission
android:name="com.mycustommap.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<uses-permission android:name="com.mycustommap.permission.MAPS_RECEIVE"/>
<application
...
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="YOUR_API_KEY_HERE" />
....
</application>
在您的 YOUR_API_KEY_HERE
是您从谷歌API的控制台复制的关键。
Where your YOUR_API_KEY_HERE
is the key you copy from the Google APIs Console.
这篇关于谷歌地图Android版上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!