Why is my voice command missing from the ok glass menu in XE16?

。_饼干妹妹 提交于 2019-11-26 02:35:04

问题


I had a Glassware that launched using a voice command on the ok glass menu. It worked great in XE12, but in XE16 it does not show up in the main menu.

Here\'s a snippet from my AndroidManifest.xml showing my voice command configuration:

<service
    android:name=\"com.mimming.sugarglider.MapDisplayService\"
    android:label=\"@string/app_name\"
    android:enabled=\"true\">
    <intent-filter>
        <action android:name=\"com.google.android.glass.action.VOICE_TRIGGER\" />
    </intent-filter>
    <meta-data
        android:name=\"com.google.android.glass.VoiceTrigger\"
        android:resource=\"@xml/show_map\" />
</service>

And here\'s the contents of show_map.xml, which defines my voice command:

<trigger keyword=\"@string/show_me_a_map\">
    <constraints network=\"true\" />
</trigger>

What\'s wrong?


回答1:


Answering my own question, since this seems to be impacting a lot of developers.

Voice commands changed a bit in XE16. Unlisted voice commands, like the one specified in your configuration, now require an additional permission. Add this to your manifest:

<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />

When you're ready to release your Glassware, you must use a built-in static voice command. XML for this kind of command would look more like this:

<?xml version="1.0" encoding="utf-8"?>
<trigger command="START_A_RUN" />

Where START_A_RUN is one of the items from this list. If none of the listed commands are appropriate for your Glassware, you should request the addition of a voice command. This can take some time, so it's best to do this as early as possible.



来源:https://stackoverflow.com/questions/23097828/why-is-my-voice-command-missing-from-the-ok-glass-menu-in-xe16

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!