I am using a JSONObject in order to remove a certin attribute I don\'t need in a JSON String:
JSONObject jsonObject = new JSONObject(jsonString);
jsonObject.
From Android 20, JSONObject preserves the order as it uses LinkedHashMap to store namevaluepairs. Android 19 and below uses HashMap to store namevaluepairs. So, Android 19 and below doesn't preserve the order. If you are using 20 or above, don't worry, JSONObject will preserve the order. Or else, use JSONArray instead.