1
protected JSONObject executeGet(String URL) throws CloudAppException {
JSONObject response = new JSONObject();
JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET, URL, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject serverResponse) {
try {
response = serverResponse;
VolleyLog.v("Response:%n %s", serverResponse.toString(4));
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
VolleyLog.e("Error: ", error.getMessage());
}
});
RequestHandler.addToRequestQueue(req);
return response;
}
的JSONObject的服务器响应理想情况下,我想分析我自己的反应,但我消隐为如何让executeGet方法返回服务器的响应。如何让排球
我有时会收到一个内存不足的错误,有时从字节数组创建字符串的...这是最低的开销这样做的方法是什么? –