You need to run GoogleVoice in the background when starting the application. How can this be implemented?
1 answer
Simplified as follows:
RecognitionListener recognitionListener = new CustomRecognitionListener(); SpeechRecognizer speechRecognizer = SpeechRecognizer.createSpeechRecognizer(context); speechRecognizer.setRecognitionListener(recognitionListener); Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); // TODO: ... Where
class CustomRecognitionListener implements RecognitionListener { // TODO: ... } More details, for example, here: VoiceInput.java .
|
onStart()application is launched and simultaneously in the background GoogleVoice. You can contact viaIntent, but then the focus will go from the application to GoogleVoice. and you just need to start and hang in the memory. - tim_tallerService, but how to organize the launch of the application? - tim_taller