Voice Recognition as a background service

前端 未结 1 361
自闭症患者
自闭症患者 2020-12-24 08:25

Is it possible to implement an activity as a service? My activity is a voice recognition activity. I want to have the activity running in the background of the app constant

相关标签:
1条回答
  • 2020-12-24 08:39

    What you can do is launch the recognizer activity which will listen for commands and when it finds an appropriate command it will do whatever you want it to do on that particular command. The problem with this simple approach is that the activity will constantly be listening for speech input and more importantly IT NEEDS TO BE IN FOCUS and not running in background...

    http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html

    0 讨论(0)
提交回复
热议问题