I\'m building an app that uses Voice Commands to perform certain functions. I got some codes working from here
private static final int SPEECH_REQUEST_CODE = 0;
Continuous Speech recognition with help of Service :-
Android Speech Recognition as a service on Android 4.1 & 4.2
GitHub Sample :-
https://github.com/galrom/ContinuesVoiceRecognition
Responding to magic words like Ok Google
https://github.com/cmusphinx/pocketsphinx-android-demo
I have implemented same feature for Banking Project. I was triggering speech to text recognition on device shake