谷歌地图在Android模拟器不显示 [英] Google Map not showing in android Emulator
本文介绍了谷歌地图在Android模拟器不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想,以显示Android模拟器谷歌地图,但只有有灰色的网格。以下是我的清单,XML和活动code。我也是获得该错误不能获得连接工厂客户端
。
I am trying to show Google map in android emulator but there's only gray grids. Following are my manifest, XML and activity code. Also I am getting error that Couldn't get connection factory client
.
下面是我的清单我已经包括上网权限:
Here is my Manifest I have included internet permission:
?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.maptry"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".Maap_tryActivity"
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>
</manifest>
XML布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:enabled="true"
android:apiKey="0l4sCTTyRmXTNo7k8DREHvEaLar2UmHGwnhZVHQ"
/>
</LinearLayout>
活动:
package com.android.maptry;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;
public class Maap_tryActivity extends MapActivity {
/** Called when the activity is first created. */
@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() {
// TODO Auto-generated method stub
return false;
}
}
请帮我在这。
推荐答案
你有没有签署自己的密钥库获得的API密钥?因为如果你没有到(以正确的方式),那么它只能显示在地图的网格。
Have you signed your own keystore to get a api key? Because if you didnt to that (the right way) then it only shows a grid of the map.
这篇关于谷歌地图在Android模拟器不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文