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

3

7

I want my app to be able to handle search requests from Google Now and appear in its Phone Search list, but I can't find any documentation on this. Does anyone have a link they can offer up?

Calypso answered 10/4, 2013 at 16:57 Comment(1)
Is this a Voice Command? Which one?Excrescence
I
8

You can add your application to the Phone Search in Google Now by setting

android:includeInGlobalSearch="true"

in your searchable.xml configuration file per the Searchable Configuration reference page. Google Now shares the same phone search options as previous versions of Android, which was often called the Quick Search Box. You'll probably also want to reference the Search Suggestions for the Quick Search Box training.

Intoxication answered 10/4, 2013 at 17:5 Comment(4)
So if I want, for example, my app to respond to searches that start with "listen to…" by searching for a music track, that would be handled by android:searchSuggestIntentData ?Calypso
@Calypso - that would be something different: android-developers.blogspot.com/2010/09/…Intoxication
I have added this attribute but still my app is now showing in the "Phone search" list...Tonyatonye
@Tonyatonye - from the Searchable Configuration reference page I linked to in my answer: "The user must still enable your application as a searchable item in the system search settings before your suggestions will appear in Quick Search Box." - make sure you do that as well!Intoxication
H
4

I, too, was looking for how to do this.

Turns out, adding your app to global search no longer works in KitKat and was removed in this commit: https://android.googlesource.com/platform/packages/apps/QuickSearchBox/+/ecf356c15143ab0583c64682de16d94a57f7dd1c

Hoagy answered 25/4, 2014 at 6:39 Comment(1)
See this other question for details about this.Sardou
T
1

Your searchable.xml needs to contain a few vital attributes before this will work. Simply adding the include global will not work. The sample app has a complete searchable.xml that works:

The ones that I have found to be mandatory for the search to show up in the "Phone search" list is:

android:searchSuggestAuthority

and

android:includeInGlobalSearch="true"
Tonyatonye answered 13/9, 2013 at 12:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.