I want to integrate Google Voice Action to support user queries from Google Assistant like Find xyz on app_name or Find xyz using app_name.

I have successfully integrated SEARCH_ACTION which supports user query from Google Assistant like Search xyz on app_name or Search xyz using app_name. I have done this using Search using a specific app.

How can I enable search with Find keyword? Twitter is supporting both options to Search using Find or Search keyword. But I am not able to find any documentation for this and it is not working with SEARCH_ACTION intent Filter.

Edit:

As per above documentation link, I have an Activity like,

<activity android:name=".SearchActivity">
    <intent-filter>
        <action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
</activity>

But this is only handling query like Search xyz on app_name.

1

There are 1 best solutions below

2
AdamK On

Implementing the Search intent (the docs you linked to) simply offers another app on the Android system the ability to call into your app by providing a generic search term. Exactly how other apps use this is up to them. One app may show an icon that links through, another may use a voice query like "search for X using app name".

Google Assistant in particular may or may not support those particular queries, but even if it does (or does not) today, that may change in the future depending on whatever the Google Assistant "app" does.

In other words, it's not really possible for you to choose exactly how this Search intent is called, only that when it is, your app responds to it appropriately.