private String jsonObjToRequestStr(JSONObject json,int length) { StringBuilder str; Iterator it; try { str = new StringBuilder(); if (length > 0) { it = json.keys(); while (it.hasNext()) { String name = it.next().toString(); try { str.append(name).append("=").append(json.get(name)).append("&"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } return str.substring(0,str.length() - 1).toString(); } finally { json = null; str = null; it = null; } }