title: Android- create JSON Array and JSON Object
body: <p>How can I create a JSON with this format in Android:
  Since the API that I will be passing will parse JsonArray then the object.
  Or would it be okay if just to pass a json object? Since I will just have to insert 1 transaction per service  call.</p>
  
  <pre><code>{
      "student": [
          {
              "id": 1,
              "name": "John Doe",
              "year": "1st",
              "curriculum": "Arts",
              "birthday": 3/3/1995
          },
          {
              "id": 2,
              "name": "Michael West",
              "year": "2nd",
              "curriculum": "Economic",
              "birthday": 4/4/1994
          }
      ]
  }
  </code></pre>
  
  <p>What I know is only the JSONObject.
  Like this one.</p>
  
  <pre><code>JSONObject obj = new JSONObject();
  try {
      obj.put("id", "3");
      obj.put("name", "NAME OF STUDENT");
      obj.put("year", "3rd");
      obj.put("curriculum", "Arts");
      obj.put("birthday", "5/5/1993");
  } catch (JSONException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }
  </code></pre>
  
  <p>Any ideas. Thanks</p>