List of utility methods to do JSON Insert
void | insertJSONArrayContent( ContentResolver contentResolver, Uri uri, JSONArray array) insert JSON Array Content Log.i("uri", uri.toString()); for (int i = 0; i < array.length(); i++) { insertJSONObjectContent(contentResolver, uri, array.getJSONObject(i)); |
void | insertJSONObjectContent( ContentResolver contentResolver, Uri uri, JSONObject obj) insert JSON Object Content ContentValues values = new ContentValues(); Iterator<String> it = (Iterator<String>) obj.keys(); while (it.hasNext()) { String key = it.next(); values.put(key, obj.getString(key)); contentResolver.insert(uri, values); |
JSONArray | concatArray(JSONArray arr1, JSONArray arr2) concat Array JSONArray result = new JSONArray(); for (int i = 0; i < arr1.length(); i++) { result.put(arr1.get(i)); for (int i = 0; i < arr2.length(); i++) { result.put(arr2.get(i)); return result; ... |