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>
Search is presented as an overlay on the home screen. Users access it by navigating to the Home screen, then pressing the microphone button. Alternately, from the Home screen users can navigate up, focus on, and click the microphone button. The global search experience is optimized for TV.
Invoking the search dialog For instance, you should add a Search button in your Options Menu or UI layout that calls onSearchRequested() . For consistency with the Android system and other apps, you should label your button with the Android Search icon that's available from the Action Bar Icon Pack.
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)":
To make this happen, you have to add intent-fiter
s 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With