2014-09-19 53 views
3

我想加入Android Wear語音功能,並按照以下網址語音功能的穿戴

https://developer.android.com/training/wearables/apps/voice.html

這裏是我的清單

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.demowearapp" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-feature android:name="android.hardware.type.watch" /> 

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

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

    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name=".MainActivity" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".TaxiActivity" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="com.google.android.gms.actions.RESERVE_TAXI_RESERVATION" /> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 

但是,當我試圖下面的語音命令在我的LG G手錶它不會打開我的活動......它只是顯示谷歌搜索結果

「OK谷歌,給我拿個稅我」

「OK谷歌,叫我車」

感謝。

+0

我已經卸下的類別默認,也是我對GMS版本的元數據:https://developer.android.com/google/play-services/setup.html(使用播放服務耐磨的依賴) – jush 2014-09-23 07:21:06

+0

@jush你的解決方案不起作用。我想知道爲什麼穿應用程序需要谷歌播放服務的語音功能。 – 2014-09-23 11:06:07

回答

0

的可穿戴不知道這是一個磨損應用。戴上應用需要這在他們的清單:<uses-feature android:name="android.hardware.type.watch" />

+0

感謝您的答覆,但它並沒有加入「android.hardware.type.watch」 – 2014-09-22 06:17:08

+0

後也工作情況,請嘗試刪除'<類機器人:名字=「android.intent.category.DEFAULT」 />'。語音功能頁面不會將此列爲此語音操作的一部分。 – kentarosu 2014-09-22 14:34:47

+0

刪除類別不起作用....請參閱我的更新的有問題的新聞文件 – 2014-09-23 06:03:44

0

有同樣的問題。解決的辦法是類別android.intent.category.DEFAULT添加到意圖過濾:

<activity android:name=".TaxiActivity" android:label="@string/app_name"> 
     <intent-filter> 
      <action android:name="com.google.android.gms.actions.RESERVE_TAXI_RESERVATION" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter> 
    </activity> 

如果你打開手機上的Android Wear應用程序,你可以驗證你的應用程序下提供「叫車」,「語音操作」的下方。

對於非英語的人還在使用語音命令,你應該仔細檢查用於語音的語言有問題的命令,您的設備上。將其更改爲英文並嘗試一下。如果仍然不起作用,您可以嘗試將設備的語言更改爲英語。