aiService.startListening(); aiService.stopListening(); Implement AIListener interface @Override public void onResult(ai.api.model.AIResponse result) { String responseText = result.getResult().getFulfillment().getSpeech(); textToSpeech.speak(speech, TextToSpeech.QUEUE_ADD, null, null); String action = result.getResult().getAction(); // The text identifier } @Override public void onError(ai.api.model.AIError error) { Log.e(TAG, "Error, " + error.getMessage()); textToSpeech.speak(“I’m sorry, I didn’t get that”, TextToSpeech.QUEUE_ADD, null, null); }