サーブレットからAndroidアプリへのブール値として画像を表示したい。サーブレットが Google App Engine にアップロードされます。これが私のサーブレットです。「arrBool」値は、ランダムな値のように表示されます。
///
resp.setContentType("text/plain");
if (req.getParameterMap().containsKey("message"))
message = req.getParameter("message");
resp.getWriter().println("Server Said" + message);
for (int i=0; i<arrBool.length; i++) {
arrBool[i] = r.nextBoolean();
if(arrBool[i]==true) {
resp.getWriter().print(arrBool);
}
}
これは私のAndroidアプリケーションファイルです:
///
RestClient client = new RestClient("http://machougul01.appspot.com/listenforrestclient");
client.AddParam("message", "Hello two World");
// client.AddParam("arrBool", "textView1");
try
{
client.Execute(RequestMethod.GET);
}
catch (Exception e)
{
textView.setText(e.getMessage());
}
String response = client.getResponse();
textView.setText(response);
}
出力には、「Server said: Hello two world」と arrBool 値:「m9a9990a m9a9990」が表示されます。 arrBool 値を m9a9990a の代わりにイメージとして設定したいです。したがって、ランダムな値が選択されている場合はいつでも、6 台中 1 ~ 6 台の車の数が表示されます。これを手伝ってください。