-3

im creating a simple app for android using Google Maps v2.

I think i did something wrong in getting the api-key ...

I followed the tutorial "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 (...)

I created a package like "com.mycustommap" and added on Api Console "key;com.mycustommap" is that right?

Also im running it on a Galaxy Note 2 and creating the project on Eclipse.

Thanks for the help

4

1 回答 1

1

如果您在 Windows 上开发,请访问

C:\Users\YOUR_USER\目录,按住Shift键,右键单击该.android文件夹并选择Open command window here

然后输入keytool -list -v -keystore debug.keystore,在要求输入密码时按回车键并复制您的 SHA1 指纹。

然后打开浏览器https://code.google.com/apis/console/前往API access并点击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.example

您的包裹名称应与您的 in 中的名称相AndroidManifest.xml匹配

<?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您从 Google API 控制台复制的密钥在哪里。

于 2013-06-24T21:11:08.367 回答