2012-04-12 7 views
0

Mapviewを使用して2つの都市間の経路を検索しようとしています。Mapviewはアンドロイドデバイスでは動作しません

問題はMapviewが動作しませんでした。デバイスのマップではなくグレーのグリッドとブロックを取得していましたが、シミュレータで正常に動作します。

はここにある私のマニフェスト

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

<uses-sdk android:minSdkVersion="8" /> 

<application 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" > 

     <uses-library android:name="com.google.android.maps" /> 

    <activity 
     android:label="@string/app_name" 
     android:name=".MapDirectionActivity" > 
     <intent-filter > 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 


</application> 

    <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"/> 

</manifest> 

ここに私のレイアウトです:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_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:apiKey="xxxxxxxxxxxxxxxxxxxxxx" 
/> 

</LinearLayout> 
+0

問題が解決しましたか? –

+0

はい解決済み –

答えて

1

は唯一のデバイスでグレーのグリッドとブロックの代わりに、マップの取得はなく、シミュレータで正常に動作します。

次のいずれかの

  1. あなたはあなたのアプリケーションに署名するために使用される署名鍵に対応する、あなたのレイアウトで右apiKeyを持っていない、または

  2. お使いのデバイスがインターネットを持っていませんGoogleのマップタイルサーバーにアクセスできない、またはそうでなければGoogleのマップタイルサーバーにアクセスできない。

行方不明のINTERNETの権限がありますが、そのように見えます)

+0

問題を解決しました...アプリケーションのAPKに署名する際に、MD5指紋用に署名された鍵も同じであることを確認してください。 –

0

OK ... "debug"のAPIキーは、エミュレータでのみ機能します。 Ecliseを使ってソフトウェアを「デバッグモード」でハンドセットにロードすると、地図ではなくタイルが表示されます。マップビューを「リリース」APIキーで更新する場合は、Eclipseの「EXPORT」を使用してapkファイルを作成し、これをハンドセットのSDカードにコピーしてからインストーラアプリ(Google Playから無料でダウンロード)を使用してインストールします電話でそれは働く!

関連する問題