title: Json array is not of proper format
body: <p>Im trying to frame a json array of following form</p>
  
  <pre><code>[
    "1-35e03ac0b6ba442bb0d5fab3faef32fe",
    {
      "request": [
        "UpdateComplianceDetail",
        {
          "remarks": "Remarks",
          "next_due_date": "27-Mar-2016",
          "completion_date": "04-Apr-2016",
          "validity_date": null,
          "documents": null,
          "compliance_history_id": 23
        }
      ],
      "session_token": "1-35e03ac0b6ba442bb0d5fab3faef32fe"
    }
  ]
  </code></pre>
  
  <p>Following is my code that i use to create json of above structure,</p>
  
  <pre><code>private JSONArray getJsonArray(String encodedString) {
          JSONArray docArray = new JSONArray();
  
          JSONObject innerJson = new JSONObject();
          JSONArray innerJsonArray = new JSONArray();
          JSONObject inJobj = new JSONObject();
          JSONArray outerJsonArray = new JSONArray();
          SharedPreferences userDetails = getSharedPreferences("userdetails", Context.MODE_PRIVATE);
          String session = userDetails.getString("session", "");
  
          try {
              innerJson.put("compliance_history_id", 23);
  
              docArray.put("null");
  
              innerJson.put("documents", docArray);
              innerJson.put("completion_date", "04-Apr-2016");
              innerJson.put("validity_date", mValidityDate.getText().toString());
              innerJson.put("next_due_date", mNextDueDate.getText().toString());
              innerJson.put("remarks", mRemarks.getText().toString());
  
              innerJsonArray.put("UpdateComplianceDetail");
              innerJsonArray.put(innerJson);
  
              inJobj.put("session_token", session);
              inJobj.put("request", innerJsonArray);
  
              outerJsonArray.put(session);
              outerJsonArray.put(inJobj);
  
          } catch (JSONException e) {
              e.printStackTrace();
          }
  
          return outerJsonArray;
      }
  </code></pre>
  
  <p>Following is the json that my code is creating,</p>
  
  <pre><code> [
    "1-35e03ac0b6ba442bb0d5fab3faef32fe",
    {
      "request": [
        "UpdateComplianceDetail",
        {
          "remarks": "Remarks",
          "next_due_date": "27-Mar-2016",
          "completion_date": "04-Apr-2016",
          "validity_date": "null",
          "documents": [
            "null"
          ],
          "compliance_history_id": 23
        }
      ],
      "session_token": "1-35e03ac0b6ba442bb0d5fab3faef32fe"
    }
  ]
  </code></pre>
  
  <p>How can I be able to sort this out? I have put "null" within json array but its being recognised as a string and not as a null. also validity_date has to be null but it is a string "null"</p>