本文介绍了创建[确定玻璃"风格的菜单,在玻璃的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始开发谷歌的玻璃,我知道了GDK如果相当新的所以这是不可能的呢,但这里是我想要为:

I have just begun developing for Google Glass, and I knew the GDK if fairly new so this may not be possible yet, but here's what I'm trying to to:

由于与拨打电话的提示或发送邮件到提示好吧玻璃屏幕上,我想我的应用程序有更多的发言权选择的选项,当你用你的声音进行选择。随着两个例子中,你将看到的联系人,你可以点头你的头向上和向下看到更多的列表,并且应用程序将只采取进一步的行动,一个你所选择的显示的选项之一。是否有任何目前的方式来做到这一点我自己的应用程序?

As with the "make a call" prompt or the "send a message to" prompts on the "okay glass" screen, I would like my app to have more voice selected options when you select it with your voice. With the two examples, you will see a list of contacts, which you can nod your head up and down to see more of, and the app will only take further actions one you've selected one of the displayed choices. Is there currently any way to do that on my own app?

任何输入AP preciated!

Any input is appreciated!

推荐答案

您可以调用的意图,显示语音识别后,你的活动已经开始。所以,你可以有你的声音触发,并从发布提示,然后在你的Activity的onResume(),调用语音识别,具有某种提示(或者你可以只字符串收集到本作的提示最初的语音)

You can call an intent to display the Voice Recognizer after your Activity has started. So, you could have your voice trigger and prompt from the launch, and then, in your Activity's onResume(), call the Voice Recognizer, with some kind of prompt (or you could just string the initial speech collected into this as the prompt):

    Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    intent.putExtra( RecognizerIntent.EXTRA_PROMPT, "ok glass, here's my prompt" );
    startActivityForResult(intent, 0);

您然后将需要的onActivityResult()方法来处理退货形成VoiceRecognizer。

You then would need an onActivityResult() method to process the return form the VoiceRecognizer.

这是所描述的在GDK文档: https://developers.google.com/glass/develop/gdk/input/voice

This is the described in the GDK docs:https://developers.google.com/glass/develop/gdk/input/voice

不知道是否有任何其他方式。

Not sure if there is any other way.

这篇关于创建[确定玻璃"风格的菜单,在玻璃的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 07:51