本文介绍了为什么XE16的“确定"玻璃菜单中缺少我的语音命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Glassware,它是通过Ok Glass菜单上的语音命令启动的.在XE12中效果很好,但在XE16中却没有显示在主菜单中.

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.

这是我的AndroidManifest.xml中的片段,显示了我的语音命令配置:

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>

这是show_map.xml的内容,它定义了我的语音命令:

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>

怎么了?

推荐答案

回答我自己的问题,因为这似乎影响了很多开发人员.

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

语音命令在XE16中有所更改.与配置中指定的语音命令一样,不公开语音命令现在需要额外的权限.将此添加到您的清单:

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

准备发布Glassware时,必须使用内置的静态语音命令.用于这种命令的XML看起来更像这样:

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

START_A_RUN此列表.如果列出的命令都不适合您的Glassware,则应请求添加语音命令.这可能需要一些时间,因此最好尽早执行此操作.

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.

这篇关于为什么XE16的“确定"玻璃菜单中缺少我的语音命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 11:46