如何延长谷歌现在语音指令在Android中使用自定义操作 [英] How to Extend Google Now Voice Commands in Android with Custom Actions

查看:98
本文介绍了如何延长谷歌现在语音指令在Android中使用自定义操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了谷歌即时桌面上的我的Nexus 4,它让我思考如何我可以用它来与我自己的应用程序进行交互。虽然我可以要求它按标题打开我的应用程序,我想知道是否有一种方法来拦截语音命令(可能通过广播接收器),所以我可以这样说:关掉客厅的灯发出一个信号,一个Arduino关闭光穿过房子的房间?在同样的注意,我一直没能找到谷歌的文档了,所以如果这是在那里我很乐意看到的链接,所以我可以只是读什么是可以从源头。

I recently installed the Google Now Launcher on my Nexus 4, and it got me thinking about how I could use it to interact with my own apps. While I can open my app by asking for it by title, I was wondering if there's a way to intercept the voice commands (possibly through a broadcast receiver) so I can say something like "turn off living room light" to send a signal to an Arduino to turn off the light in a room across the house? On the same note, I haven't been able to find the documentation for Google Now, so if that's out there I would love to see the link for it so I can just read what's available from the source.

推荐答案

是的。您可以使用Android的意图模型做到这一点。 谷歌现在触发各种意图解析你的命令后,如果手机有注册来处理这种意图的应用程序,谷歌现在谁的用户选项来执行命令。 常见的意图有:报警器,健身,媒体 https://developer.android.com/guide/components/intents-common html的#现在

Yes. You can do it using the Android-Intent model. Google Now fires various intents after parsing your command, and if the phone has an app registered to handle such intent, google now will who user the options to execute the command. Common Intents are: Alarm, Fitness, Media https://developer.android.com/guide/components/intents-common.html#Now

这篇关于如何延长谷歌现在语音指令在Android中使用自定义操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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