我無法在我已發佈到Google Play(私人頻道)上的應用中成功使用Google系統語音操作「搜索應用」(com.google.android.gms.actions.SEARCH_ACTION
)並下載到我的手機上。已發佈到Google Play但無法使用Google語音操作的應用
與匹配意圖過濾器後,查詢額外來自搜索操作的意圖將被傳遞到MainActivity
。
發佈應用程序之前,我已經測試使用adb
命令的應用程序下面這完美的作品:
adb shell am start -a "com.google.android.gms.actions.SEARCH_ACTION" --es query "[query]" -n "com.testapp/.MainActivity"
下面是我的Android清單包含的意圖過濾器:
<?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>
是我的Google Voice操作所需的意圖過濾器設置正確,如果是這樣,爲什麼使用Google App在我的應用中搜索關鍵字無效?或者是否還有其他考慮因素,如(僅針對某些個人猜測):Google App需要「緩存/處理」應用內容/意圖過濾器等所需的時間,應用名稱和搜索關鍵字不夠「獨特」,或者事實該應用程序是否分發到私人頻道?
希望任何已成功實施Google Voice操作的人共享並提供一些輸入。
是android中所述的應用程序的名稱:標籤,圖標下出現的名稱還是別的嗎?如果是的話,哪一個如何在應用商店中設置? –
在開發過程中,您是如何確保其按預期工作的? – GvSharma
那麼之後,您的應用程序已經與Google Voice配合良好了嗎?我有同樣的問題,請建議。 – cuasodayleo