Android Utililty Methods JSON Insert

List of utility methods to do JSON Insert

Description

The list of methods to do JSON Insert are organized into topic(s).

Method

voidinsertJSONArrayContent( 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));
voidinsertJSONObjectContent( 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);
JSONArrayconcatArray(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;
...