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?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Seanonymous
  • 1,304
  • 10
  • 30

3 Answers3

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.

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443
  • 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 ? – Seanonymous Apr 10 '13 at 18:35
  • @Seanonymous - that would be something different: http://android-developers.blogspot.com/2010/09/supporting-new-music-voice-action.html – ianhanniballake Apr 10 '13 at 18:48
  • I have added this attribute but still my app is now showing in the "Phone search" list... – slott Sep 13 '13 at 10:31
  • @slott - 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! – ianhanniballake Sep 13 '13 at 16:01
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

Foxichu
  • 952
  • 10
  • 22
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"
duggu
  • 37,851
  • 12
  • 116
  • 113
slott
  • 3,266
  • 1
  • 35
  • 30