Use the SpeechRecognizer interface. Your app needs to have the RECORD_AUDIO permission, and you can then create a SpeechRecognizer, give it a RecognitionListener and then call its startListening
method. You will get callbacks to the listener when the speech recognizer is ready to begin listening for speech and as it receives speech and converts it to text.