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;
You will need to write a service for continuous speech recognition. And based on the inputs you get as speech detect your trigger phrase and take action.
This may be memory intensive and you will need to optimize by starting and stopping services on appropriate times and screens.
The accepted answer to this question provides a means to achieve a similar thing.