11

AndroidのGoogleマップで実現可能性テストを実行しようとしています。

Google マップ Android V1

MapView を使用する場合は、追加する必要があります

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

androidmenifest.xml で。しかし、私の知る限り、このライブラリが組み込まれていないデバイスがいくつかあります。そのため、アプリケーションをこれらのデバイスにインストールすることさえできませんでした。

Google マップ Android V2

V2 では、マップは extra/google_play_services の sdk によってサポートされています。このアプローチは優れていますが、依然として Google Play サービスに依存しています。サービスをアンインストールすると、次のスクリーンショットのような警告メッセージが表示されます。

グーグルマップのデモ

ボタンをクリックすると、クラッシュして例外がスローされました。

android.content.ActivityNotFoundException: Intent を処理するアクティビティが見つかりません { act=android.intent.action.VIEW dat= http://play.google.com/store/apps/details?id=com.google.android.gms flg =0x80000 pkg=com.android.vending }

これは、インテントを処理するために、テスト前にアンインストールされた google play が見つからないためです。ただし、pkg=com.android.vending を指定しなくても、ブラウザでインテントを処理できます。

だから..ここに私の質問があります。

  1. 上記の Intent を自分のアプリでインターセプトして処理することはできますか? だから私はそれをブラウザに渡すことができます。

  2. それが不可能な場合、マップを使用して Android アプリを開発するための最良のソリューションは何ですか。Google マップや Google Play がインストールされていない多くの Android デバイスがあることは承知しています。使用中のクラッシュは許容できません。

4

2 に答える 2

5

Actually, the problem relates to Gingerbread and older phones using the wrong URI if they don't already have the Play Store installed. This isn't a safe assumption. Most out-of-the-box Gingerbread phones don't come with it, and Google updates don't necessarily install it. This is a known bug in Google Play services V2. See the discussion on Google Code

A hack to get around it is discussed, but you'd need to intercept the button press to use it.

于 2013-02-07T14:55:04.923 に答える
1

google map を実行するには、google map api を使用する必要があります。Google API で AVD を作成し、その AVD (エミュレーター) でプロジェクトを実行します。

ここに画像の説明を入力

于 2012-12-11T09:41:23.533 に答える