Android版谷歌地图有问题吗
我正在尝试为Android 2.3.3安装一个基本的Google地图应用程序。我试着在Eclipse、NetBeans和IntelliJ IDEA中进行开发。失败太多次后,我又回到了基础阶段。请帮助我使用API v1 目前我的地图显示为空白(emulator和我的真实设备)。这是我的代码(顺便说一下,我尝试了所有可能的权限标记): 我用默认的调试密钥在应用程序上签名,即使在发布版本中签名时,我仍然得到空白映射。 我只想看一张真实的地图。 (顺便说一下,我不确定这里的文本格式是否正确,所以简而言之,我只是从这里复制了代码1-1) 舱单Android版谷歌地图有问题吗,android,google-maps,android-layout,google-api,keytool,Android,Google Maps,Android Layout,Google Api,Keytool,我正在尝试为Android 2.3.3安装一个基本的Google地图应用程序。我试着在Eclipse、NetBeans和IntelliJ IDEA中进行开发。失败太多次后,我又回到了基础阶段。请帮助我使用API v1 目前我的地图显示为空白(emulator和我的真实设备)。这是我的代码(顺便说一下,我尝试了所有可能的权限标记): 我用默认的调试密钥在应用程序上签名,即使在发布版本中签名时,我仍然得到空白映射。 我只想看一张真实的地图。 (顺便说一下,我不确定这里的文本格式是否正确,所以简而言之
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hellogooglemaps"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8"/>
<application android:label="@string/app_name">
<uses-library android:name="com.google.android.maps"/>
<activity android:name="MyActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
如果您对default.keystore使用MD5 然后转到Windows>显示视图>其他>仿真器控件 然后单击Emulator控件中的发送按钮发送(十进制坐标) 然后再次运行您的应用程序地图,它应该显示一些默认的美国位置 要在设备中获取映射,您需要从应用程序密钥库而不是默认密钥库创建MD5
谢谢。谷歌地图API V1的代码看起来不错。所以你的钥匙一定有问题。据我所知,如果它是一个新生成的密钥,那么Google不会为Google Map API V1提供密钥,因此它必须是Google Map API V2的密钥,这就是它不起作用的原因 请试试地图V2, 生成后使用正确的映射键,并考虑以下事项:
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="BLA_BLA_BLA_GOT_A_KEY"
/>
package com.example.hellogooglemaps;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
public class MyActivity extends MapActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
}
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxx"/>
<activity android:name="MyActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
</application>