MapView不工作[android]
加载MapView应用程序时,MapView仅显示灰色网格线 这是我的密码: main.xml:MapView不工作[android],android,android-mapview,Android,Android Mapview,加载MapView应用程序时,MapView仅显示灰色网格线 这是我的密码: main.xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="0aOphT3vlZFVSL1HZ2Vg-RmIDhH0nPlp8e7gJrg"/>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.andoid.googlemaps"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:name="com.google.android.maps"></uses-library>
<activity android:name=".GMapsActivity"
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-sdk android:minSdkVersion="1" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
package com.andoid.googlemaps;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
public class GMapsActivity extends MapActivity {
private MapView mapView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* Proxy Settings*/
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", "proxy.example.com");
System.setProperty("http.proxyPort", "8080");
setContentView(R.layout.main);
mapView=(MapView)findViewById(R.id.map_view);
mapView.setBuiltInZoomControls(true);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
}
提前感谢您的帮助…请参阅以下有关显示谷歌地图的链接。这可能对你有帮助
用于映射的API密钥取决于用于签署应用程序的证书。 您必须按照以下说明获取有效的API密钥 Android Maps API允许您在自己的Android应用程序中嵌入谷歌地图。单个Maps API密钥对于由单个证书签名的所有应用程序都有效。有关应用程序签名的更多信息,请参阅此文档页。要获取证书的Maps API密钥,您需要提供证书指纹的密码。这可以使用Keytool获得。例如,在Linux或Mac OSX上,您可以像下面这样检查调试密钥库: 看
这通常意味着您需要一个用于调试构建的密钥和另一个用于发布构建的密钥(例如,Android market的签名应用程序包)。经过长时间的工作后。但仍然没有找到问题所在。事实上,我没有做任何更改,只是与我的朋友共享了debug.keystore,并且它工作正常。无论如何,谢谢你的回复…你为什么有代理人?这就是您实际使用的代理吗?是的,我正在代理网络中工作。是的,我已经这样做了。请通过以下链接: