15

I want to make my app searchable in the Google Now quick search box. I followed some examples but it still doesn't work. The official doc isn't clear at all about how to make this case work.

Now after checking these stackoverflow issues, I start wondering if this feature is still available to the developer?

Is global search in android still available for developer?

How do I get my app to appear in Google Now's Phone Search list?

I do see a few apps still make into the "Phone search" list in the quick search box settings. If so, anyone can shed some light for me? My searchable config xml is as follows

<searchable xmlns:android="http://schemas.android.com/apk/res/android"
    android:label="@string/app_name"
    android:hint="@string/search_hint"
    android:searchSuggestAuthority="@string/search_authority"
    android:searchSuggestIntentAction="android.intent.action.VIEW"
    android:searchSuggestIntentData="content://some_search_authority"
    android:includeInGlobalSearch="true">
</searchable>

In this AndroidManifest.xml file, I do have meta-data specified for the SearchableActivity e.g.

<activity ...>
    <intent-filter>
        <action android:name="android.intent.action.SEARCH" />
    </intent-filter>
    <meta-data
        android:name="android.app.searchable"
        android:resource="@xml/searchable" />
</activity>
Community
  • 1
  • 1
hxc
  • 162
  • 8
  • I don't think I understand your question: you need to search *content* of your app from Google Now quick search box or you need that your app must be listed on suggestion? – JJ86 Jan 12 '16 at 11:13
  • look into app indexing – Mo1989 Jan 14 '16 at 16:51

1 Answers1

7

It's not possible (at least, yet).

Google Music has a Google Now card and to have something similar, you need to create your own.
Unfortunately, it has no public API yet: Google Now integrations

Now cards from apps are currently under development and are not available to all apps. We'll let you know when we are able to onboard more partners.

What you can do is to add your app into the list of suggestion for command "Play (Band name) (Song name)":

enter image description here

To make this happen, you have to add intent-fiters to your Activity, which should be opened to AndroidManifest:

    <activity
        android:name=".MusicActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

You can check out list of Google Now voice commands here: A list of all the Google Now voice commands

I hope, it helps

Konstantin Loginov
  • 15,802
  • 5
  • 58
  • 95