How to make Google Now run continually in the background on Android

我怕爱的太早我们不能终老 提交于 2019-12-03 06:46:13

问题


I have a app idea in mind, but I haven't been able to figure out one part yet. In Google Now on Android, it gives you the following options to search:

  1. Type to search
  2. Click microphone to say your search
  3. Or just Say "Google" to make the voice search begin.

I'd like to know how they made #3 work. I need to have a keyword, that when said, initiates the voice search.

I imagine they have some type of background running service constantly listening for voice actions. Does anyone know how this is achieved?

Here is a image of the Google Now app:


回答1:


You can write a service and then use createSpeechRecognizer in that service. 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




回答2:


Yes can createSpeechRecognizer service and that work perfectly fine

you need to check this-: https://github.com/jigarfumakiya/TextToSpeechcontinuously



来源:https://stackoverflow.com/questions/16219601/how-to-make-google-now-run-continually-in-the-background-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!