11月の初旬頃、アナウンスされた「App Indexing」。
Google検索での検索結果画面に、ダイレクトでアプリを起動できるボタンが表示されるようになるというやつ。

App Indexing for Google Search — Google Developers 
今はまだ、日本では、いや、USでも、公開されてないような雰囲気ですが。
まずは登録すればUSから利用できるようになるとか。

App Indexing - Expression of Interest 
利用の手順としては、公開サイトやそのサイトマップに「おれおれスキーム」なURLを埋め込んでおきなさい、と。
きっとクローラが持っていくのでしょう。

そして、アプリ側には、ブラウザ上のクリックに反応する <intent-filter> を記述しておきなさい、以下2つのURIに対してのクリックに反応するよ、と。
・ http://www.example.com/gizmos
・ example://gizmos
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "example://gizmos" -->
<data android:scheme="example"
android:host="gizmos" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos" -->
<data android:scheme="http"
android:host="www.example.com"
android:pathPrefix="gizmos" />
</intent-filter>
この記述をアプリに適用したら、以下のコマンドで試してみたらいいらしい。
$ adb shell am start -W -a android.intent.action.VIEW -d "example://gizmos" com.example.android
で、やってみたら、
続きを読む >>