2012-01-31 23 views
1

アンドロイドエミュレータでGoogleマップを表示しようとしていますが、灰色のグリッドしか表示されません。以下は私のマニフェスト、XML、アクティビティコードです。また、Couldn't get connection factory clientというエラーが発生しています。この上で私を助けてくださいGoogleマップがアンドロイドエミュレータに表示されない

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; 
} 
} 

?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> 

活動:ここ

は、私はインターネットのアクセス許可が含まれている私のマニフェストです。

+1

[アンドロイドMapActivity:接続ファクトリのクライアントを取得できませんでした] [1] [1]:http://stackoverflow.com/questions/6006835/android-mapactivity-couldnt-get -connection-factory-client – rishi

+0

Thanx Friendz ....私はJDK 7を使用していたので、MD5ではなくSHA1でキーを生成していました... JDK 6を使用すると、MD5でキーを生成できます。私の問題を解決しました。 – user1132265

答えて

1

APIキーを取得するために独自のキーストアに署名しましたか?なぜなら、あなたがそれを正解しなかったら、地図のグリッドしか表示されないからです。

More info here

+0

Thanx Friendzが見つかりました。JDK 7を使用していたので、MD5ではなくSHA1でキーを生成していました...今はJDK 6を使用するとMD5でキーを生成できます。そして、それは今私の問題を解決して、それは正常に動作します – user1132265

+0

良い音!がんばろう! – Fergers

1

このリンクを参照してください:

のAndroidでGoogleマップのためにおそらく最もよいなめる:

http://mobiforge.com/developing/story/using-google-maps-android

は、キーストアに署名するために慎重にその最初のチュートリアルに従ってください。これは役立つかもしれない

関連する問題