Search code examples
android-studioibm-cloudibm-watsonwatson-conversation

watson-developer-cloud/android-sdk-Conversation


Hello I am referring this Android sdk Watson Language Translation example and replacing with Conversation Service to deploy the application at Android Platform. At the sample code they have a class(image below) at MainActivity.java. How do I make the necessary changes in syntax format for Conversation Service of this particular class? Please help. enter image description here


Solution

  • ConversationService conversationService = new ConversationService(ConversationService.VERSION_DATE_2016_07_11, userName, password);
    MessageRequest.Builder messageRequestBuilder = new MessageRequest.Builder();
    messageRequestBuilder.inputText(question);
    ServiceCall<MessageResponse> response = conversationService.message(workspaceId, messageRequestBuilder.build());
    MessageResponse answer =  response.execute();