简体   繁体   English

通过通知的Android语音命令

[英]Android voice commands through notifications

Is it possible to send voice commands to an application via background service/ notification? 是否可以通过后台服务/通知向应用程序发送语音命令?

I know it works when the application is in foreground; 我知道当应用程序处于前台时它可以工作; I need to use a Bluetooth headset and send commands to an application while this runs in the background as a service. 我需要使用蓝牙耳机并将命令发送到应用程序,而这是作为服务在后台运行的。

You can write a service and then use createSpeechRecognizer in that service. 您可以编写一个服务,然后在该服务中使用createSpeechRecognizer。 For a complete service code for this you can find the answer at Android Speech Recognition as a service on Android 4.1 & 4.2 有关此服务的完整服务代码,您可以在Android Speech Recognition上找到答案, 作为Android 4.1和4.2上的服务

It's a feature like this? 是这样的功能吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM