0

enter image description here AndroidスタジオからAPI呼び出しを行っています。エラーはありませんが、ADBで実行すると、私のアプリは「残念ながらアプリが停止しました」と言って止めます。誰も見て、何が間違っているのか教えてください。ありがとうございますワトソンAPI呼び出しに失敗しました

答えて

0

アプリケーションのワークスペースIDを設定する必要がありますが、わかりますか?

例:

ConversationService service = new ConversationService("08-11-2016"); 
service.setUsernameAndPassword("{username}", "{password}"); 

MessageRequest newMessage = new MessageRequest.Builder() 
    .inputText("Turn on the lights") 
    // Replace with the context obtained from the initial request 
    //.context(...) 
    .build(); 

String **workspaceId** = "**ID from your conversation...**"; 

MessageResponse response = service 
    .message(workspaceId, newMessage) 
    .execute(); 

System.out.println(response); 
+0

私はそれが動作しませんでした、ワークスペースのIDが含まれました。 –

+0

ありがとうございます@Sayuri、私はコードのあなたの方法を試してみました、私の携帯電話上のapkアプリだけでなく、ADBを介して実行中に、そのクラッシュ。 –

関連する問題