Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add my app into the google local search?

Tags:

android

In the android we can see that there is a default "google search" on the launcher. And I found out that using setting, we can set the searchable items. For example amazon kindle, music, or browser.

The question is, how can I add my app into the searchable items in the google search? Are there any APIs I can use?

like image 813
s011208 Avatar asked Oct 08 '22 06:10

s011208


1 Answers

Exactly, the first thing you do is provide a searchable.xml resource to Android. How this is done is described here.

Next, you have to declare an Activity to be searchable in your Manifest, like so:

<activity android:name="...">
  <intent-filter>
    <action android:name="android.intent.action.SEARCH" />
  </intent-filter>
  <meta-data android:name="android.app.searchable" android:resource="@xml/searchable" />
</activity>
like image 67
Matthias Avatar answered Oct 12 '22 10:10

Matthias