清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.locdroid_v2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<permission android:name="com.example.locdroid_v2.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.example.locdroid_v2.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name="com.example.locdroid_v2.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.example.locdroid_v2.Connexion"
android:screenOrientation="portrait" >
</activity>
<activity android:name="com.example.locdroid_v2.Inscription"
android:screenOrientation="portrait" >
</activity>
<activity android:name="com.example.locdroid_v2.Rapide"
android:screenOrientation="portrait" >
</activity>
<activity android:name="com.example.locdroid_v2.Map"
android:screenOrientation="portrait" >
</activity>
<activity android:name="com.example.locdroid_v2.GoogleMap"
android:screenOrientation="portrait" >
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="MyKey"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@+integer/google_play_services_version" />
</application>
</manifest>
我的XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="MyKey"
android:clickable="true"
/>
</RelativeLayout>
爪哇 包com.example.locdroid_v2;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class GoogleMap extends MapActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.googlemap);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
}
Google地图无法正常显示,只显示网格。 并且只有一个错误:无法获得连接工厂客户端
这是我的图书馆 Android的支持,v4.jar Apache的mime4j-0.6.1.jar 谷歌播放,services_lib.jar 谷歌播放,services.jar httpmime-4.2.3.jar osmdroid-Android的1.04.jar SLF4J-机器人-1.6.1-RC1.jar
你能帮帮我吗?
答案 0 :(得分:0)
这个
<uses-library android:name="com.google.android.maps" />
和这个
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="MyKey"
android:clickable="true"/>
是旧谷歌地图库,这不是你想要的。你需要谷歌地图v2库