Adding voice features on Android Wear

I am trying to configure the application to respond to one of the system voice actions .

Following the link mentioned above, I have to declare, as part of my aiking, actions that have a very specific target filter.

In my sample application, I tried to β€œhook” on the β€œSet timer” action of Voice, so mine AndroidManifest.xmlhas the following code:

    <activity android:name=".wear.MyActivity2">
        <intent-filter>
            <action android:name="android.provider.AlarmClock.ACTION_SET_TIMER" />
        </intent-filter>
    </activity>

Then I linked, signed and installed the application on my phone. Then I confirmed that the application is installed both on my phone and on the watch (LG G Watch).

After everything became correct, I tried to check whether my application was indicated as an β€œoption” for the voice action β€œSet timer” in the Android Wear application. => This is not so.

Then I tried to restart the phone and watch, and in the end I tried the "Update apps" button, which appears in the menu "Android Wear" β†’ "Settings".

Nothing changed. It seems that I can not make the Android Wear app aware of my app so that it listens to the desired voice action and acts accordingly.

Notes:

  • I tried other voice actions (even the one given as an example in the link - Accept note)
  • I tried different reload / resync permutations
  • , Android android
  • , ...
+4
1

:

<intent-filter>
  <action android:name="android.intent.action.SET_TIMER"/>
  <category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
-1

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


All Articles