private static SpeechletResponse buildSpeechletResponse(String output){
  String title="Package Tracker";
  SimpleCard card=new SimpleCard();
  card.setTitle(title);
  card.setContent(output);
  PlainTextOutputSpeech speech=new PlainTextOutputSpeech();
  speech.setText(output);
  SpeechletResponse response=new SpeechletResponse();
  response.setShouldEndSession(false);
  response.setOutputSpeech(speech);
  response.setCard(card);
  return response;
}

private static SpeechletResponse buildSpeechletResponse ( String output ) { String title = "Package Tracker" ; SimpleCard card = new SimpleCard ( ) ; card . setTitle ( title ) ; card . setContent ( output ) ; PlainTextOutputSpeech speech = new PlainTextOutputSpeech ( ) ; speech . setText ( output ) ; SpeechletResponse response = new SpeechletResponse ( ) ; response . setShouldEndSession ( false ) ; response . setOutputSpeech ( speech ) ; response . setCard ( card ) ; return response ; }
creates and returns the visual and spoken response with shouldendsession flag .
