I am unable to successfully use the Google System Voice Actions "Search in 
App" (com.google.android.gms.actions.SEARCH_ACTION) on an app that I have 
already published onto Google Play (Private Channel) and downloaded onto my 
phone.

The intent with the query extra from the search action is to be passed on 
to MainActivity after matching the intent filter.

Before publishing the app, I have already tested the app using the adb 
command below which works perfectly:

adb shell am start -a "com.google.android.gms.actions.SEARCH_ACTION" --es 
query "[query]" -n "com.testapp/.MainActivity"

Below is my Android manifest which contains the intent filters:

<?xml version="1.0" encoding="utf-8"?><manifest
    xmlns:android="http://schemas.android.com/apk/res/android";
    package="com.testapp" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="23" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:name=".app.AppController"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        android:allowTaskReparenting="true">

        <meta-data
            android:name="com.google.android.gms.version" 
            android:value="@integer/google_play_services_version" />

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:exported="true"
            android:launchMode="singleTop" >

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

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

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>

            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>

            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable" />

            <meta-data
                android:name="android.app.default_searchable"
                android:value=".MainActivity" />

        </activity>

    </application>
</manifest>


Are my intent filters required for Google Voice Actions set up correctly, 
and if so, why did using Google App to search for keywords within my app 
not work?

Or are there any other considerations such as (some personal guesses only): 
time needed for Google App to "cache/process" app contents/intent filters 
etc., the app name and search keywords not being "unique" enough, or the 
fact that the app being distributed onto a Private Channel instead?

Hoping for anyone who has successfully implemented Google Voice Actions 
before to share and provide some input.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/fc69c628-adbe-44d4-ac93-bed385107f57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to