Android的磨损自定义语音操作 [英] Android Wear Custom Voice Actions

查看:143
本文介绍了Android的磨损自定义语音操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个应用程序,将与Android Wear, 我想执行一个命令到谷歌的谷歌确定选项。 我看到这个页面: <一href="http://developer.android.com/training/wearables/apps/voice.html">http://developer.android.com/training/wearables/apps/voice.html

I'm making an app that will work with Android Wear, And I wanted to implement a command into Google's "Ok Google" option. I saw this page: http://developer.android.com/training/wearables/apps/voice.html

但它仅涉及包括在Android Wear活动的应用程序。

But it's related only to apps that include Activities in the Android Wear.

我想问问:

  1. 我可以添加自定义命令?我的意思是,那些谁不启动以单词开始?
  2. 我可以添加命令会做另一件事比刚刚开放的应用程序?就像跑的方法?

如果这不是问这个地方,你能不能给我一个电子邮件/链接到谷歌开发人员帮助/支持?谢谢。

If it's not the place to ask this, can you give me an email/link to Google Developers help/support? thanks.

推荐答案

对于在Android Wear设备上运行的应用程序:

For apps that run on the Android Wear Device:

  1. 没有,系统提供的语音操作的列表是固定的(在这里列出 )。你可以设置你的应用程序能够响应它们(例如,请记的),但你不能添加新的。
  2. 是。当已经在您的应用程序里面,你可以使用 startActivityForResult()使用 ACTION_RECOGNIZE_SPEECH 来获取语音输入。然后,您可以使用返回的字符串来执行任何你想要的。
  1. No, the list of system-provided voice actions is fixed (and listed here). You can set your application to be able to respond to them (for example, to take a note), but you cannot add new ones.
  2. Yes. When already inside your app, you you can use startActivityForResult() using the ACTION_RECOGNIZE_SPEECH to get voice input. You could then use the returned string to execute whatever you want.

同时,如果你只是从一个Android应用程序的手持运行显示通知,那么你就不能presently拥有的语音操作的所有(在字面意义上,至少)。你可能有什么,不过,是请求语音输入一个通知操作。该输入将被传递在Intent一个额外的被输送到该应用在手持

Meanwhile, if you're just displaying notifications from an Android app running in a handheld, then you cannot presently have voice actions at all (at least in a literal sense). What you may have, though, is a notification action that requests voice input. That input will then be passed as an extra in the Intent that is delivered to the app in the handheld.

这篇关于Android的磨损自定义语音操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆