my code is:
 JSONObject jChild=new JSONObject();
         JSONObject jParent=new JSONObject();
            for (Product p : boxAdapter.getBox()) {
              if (p.checked){
                try {
                    jChild.put("uid", p.uid);
                list.add(String.valueOf(jChild));
                    //list.add(String.valueOf(jParent));
                } catch (JSONException e) {
                    e.printStackTrace();
                }
              }
            }
            jParent.put("users", list);
          // Toast.makeText(this, ""+jParent, Toast.LENGTH_LONG).show();
            Log.v("TakeAttendance","JSONpARENT "+String.valueOf(jParent));
Output :
{"users":"[{\"uid\":\"4\"}, {\"uid\":\"5\"}, {\"uid\":\"6\"}]"}
What i actually need :
  {users: [
    {
    name: "acx",
    uid: "2"
    },
    {
    name: "test",
    uid: "6"
    },
    {
    name: "ccc",
    uid: "11"
    }
    ]
    }
 
     
     
     
     
     
    