2012-02-08 43 views
-1

我想加載谷歌地圖,但我一直在得到「無法獲得連接工廠客戶端。地圖加載,所以我假設關鍵是正確的,但那就是我所能做的該縮放控件將不會加載在所有的,我不能在所有的移動地圖。無法獲取連接工廠客戶端瓷磚加載android

package com.saff.maps; 

import android.content.Context; 
import android.location.Location; 
import android.location.LocationListener; 
import android.location.LocationManager; 
import android.os.Bundle; 

import com.google.android.maps.GeoPoint; 
import com.google.android.maps.MapActivity; 
import com.google.android.maps.MapController; 
import com.google.android.maps.MapView; 


public class gpsActivityTest extends MapActivity{ 
private MapController mMapController; 
private GeoPoint mGeoPoint; 

public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    MapView mMapView = new MapView(this, "033wSZETHVmHYoRTPurperVQKTS8-zCsTzcbcaA"); 
    setContentView(mMapView); 
    mMapView.setBuiltInZoomControls(true); 
    mMapController = mMapView.getController(); 
    LocationManager mLocation= (LocationManager) getSystemService(Context.LOCATION_SERVICE); 
    mLocation.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, new updateHandler()); 
} 

@Override 
protected boolean isRouteDisplayed() { 
    return false; 
} 

public class updateHandler implements LocationListener{ 

    public void onLocationChanged(Location location) { 
    int lat = (int) (location.getLatitude() * 1E6); 
    int lng = (int) (location.getLongitude() * 1E6); 
    mGeoPoint = new GeoPoint(lat, lng); 
    mMapController.animateTo(mGeoPoint); 
    mMapController.setCenter(mGeoPoint); 

    } 

    public void onProviderDisabled(String provider) { 
     // TODO Auto-generated method stub 

    } 

    public void onProviderEnabled(String provider) { 
     // TODO Auto-generated method stub 

    } 

    public void onStatusChanged(String provider, int status, Bundle extras) { 
     // TODO Auto-generated method stub 

    } 

} 

} 


<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.saff.maps" android:versionCode="1" android:versionName="1.0"> 

    <uses-sdk android:minSdkVersion="8" /> 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 

    <application android:icon="@drawable/ic_launcher" android:label="@string/app_name"> 
     <uses-library android:name="com.google.android.maps" android:required="true" /> 
     <activity android:label="@string/app_name" android:name=".gpsActivityTest"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 

我沒有把我的API代碼在xml文件,因爲我得到「便無法找到mapViewStyle主題「。我不知道什麼問題是肯定的,我不會有這個問題,如果我的api鍵是正確的

我GOOGLE了廣泛,但不回答我的問題,因爲我沒有其他錯誤除此之外,這裏是我的logcat:

02-10 00:10:26.305: I/Zygote(721): Zygote: pid 721 has INTERNET permission, then set capability for CAP_NET_RAW 
02-10 00:10:27.135: I/ApplicationPackageManager(721): cscCountry is not German : H3G 
02-10 00:10:31.145: I/MapActivity(721): Handling network change notification:CONNECTED 
02-10 00:10:31.145: E/MapActivity(721): Couldn't get connection factory client 
02-10 00:10:31.145: V/InputMethodManager(721): onWindowFocus: null softInputMode=288 first=true flags=#10100 
02-10 00:10:31.145: V/InputMethodManager(721): Has been inactive! Starting fresh 
02-10 00:10:31.145: V/InputMethodManager(721): focusIn: [email protected] 
02-10 00:10:31.145: V/InputMethodManager(721): checkFocus: view=null [email protected]52e0 restart=true 
02-10 00:10:31.145: V/InputMethodManager(721): Starting input: [email protected]52e0 
02-10 00:10:31.145: V/InputMethodManager(721): Starting input: [email protected] ic=null 
02-10 00:10:31.175: V/InputMethodManager(721): START INPUT: [email protected] ic=null [email protected] initial=true 
02-10 00:10:31.495: V/InputMethodManager(721): Starting input: Bind result=InputBindResult{null com.swype.android.inputmethod/.SwypeInputMethod #5} 
02-10 00:10:32.265: V/InputMethodManager(721): Starting input: [email protected]52e0 
02-10 00:10:32.265: V/InputMethodManager(721): Starting input: [email protected] ic=null 
02-10 00:10:32.265: V/InputMethodManager(721): Starting input: finished by someone else ([email protected]52e0 conn=false) 

回答

0

如果試圖問問題之前google搜索多一點,你會找到這Answer多。

相關問題