Voice Wear Features in Android Wear

I am trying to add voice features to Android Wear and follow the URL below

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

Here is my manifest

<?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> 

But when I try to use voice commands in my LG G watch, it doesn’t open my activity ... it just shows Google search results.

Ok give me a taxi

"OK, call me a car"

Thanks.

+3
source share
2 answers

Socks do not know what this app is for wearing. Wear the app you need this in your manifest: <uses-feature android:name="android.hardware.type.watch" />

0
source

There was the same problem. The solution was to add the android.intent.category.DEFAULT category to the intent filter:

  <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> 

If you open the Android Wear app on your phone, you can verify that your app is available in the “Call Car” section under “Voice Actions”.

For non-English-speaking users still having problems using voice command, you should double-check the language used for voice commands on your device. Change it to English and try. If this still does not work, you can also try changing the device language to English.

0
source

Source: https://habr.com/ru/post/1204221/


All Articles