4
votes

I'm trying to set up my application to respond to one of the system-provided voice actions .

By following the above mentioned link I should declare, within my android wear apk, an activity that has a very specific intent filter.

In my sample application i tried to "hook" on the "Set a timer" Voice action so my AndroidManifest.xml has the following code:

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

I then bundled, signed and installed the app in my phone. I then verified that the app got installed in both my phone and the watch ( LG G Watch ).

After veryfiying that everything went right i tried to see if my app was listed as "option" for the "Set timer" voice action within the "Android Wear" app. => It didn't.

I then tried rebooting both the phone and the watch and ultimately i tried the "Refresh apps" button that is shown within the "Android Wear" -> "Settings" menu.

Nothing changed. It looks like i cannot make the "Android Wear" app aware of my app so that it listens for the desired voice action and acts accordingly.

Notes:

  • I tried also other voice actions ( Even the one provided as example in the link - Take a note )
  • I tried different permutations of reboot/resync
  • I double checked that the android wear app was the latest compiled
  • Both phone and wear app share the same package name
  • The Activity does nothing except showing the hello world layout...
1
in development mode you need to deploy your wearable app manually to the watch - see Packaging Wearable Apps in the docs.Peter Friese

1 Answers

-1
votes

Use this intent filter instead:

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