public static HashMap<String,Object> jsonToMap(JSONObject object) { HashMap<String,Object> jsonMap = new HashMap<String,Object>(); Iterator<String> keyIter = object.keys(); String key; Object value; while (keyIter.hasNext()) { try { key = (String) keyIter.next(); value = object.get(key); jsonMap.put(key,value); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return jsonMap; }