title: Java Append object to JSON
body: <p>I would like to append JSON object to existing JSON array to get data structure like this.</p>
  
  <pre><code>"results":[
        {
           "lat":"value",
           "lon":"value"
        }, 
        {
           "lat":"value",
           "lon":"value"
  
        }
      ]
  </code></pre>
  
  <p>I'm trying to do it using the code in example, but unfortunately whole object is overriden everytime. </p>
  
  <pre><code>    Log.i(AppHelper.APP_LOG_NAMESPACE, "POSITIONS AVAILABLE " + jsonDataString);
                  AppHelper helper = new AppHelper(ctx);
                  JSONObject mainObject = new JSONObject(jsonDataString);
                  JSONObject valuesObject = new JSONObject();
                  JSONArray list = new JSONArray();
                  //putv given values to the JSON
                  valuesObject.put("lat", lat.toString());
                  valuesObject.put("lon", lon.toString());
                  valuesObject.put("city", city);
                  valuesObject.put("street", street);
                  valuesObject.put("date", helper.getActualDateTime());
                  valuesObject.put("time", helper.getActualDateTime());
                  list.put(valuesObject);
                  //mainObject.put("values", list);
                  mainObject.accumulate("values", list);
                  saveJsonData(ctx, mainObject.toString(),"positions");
  </code></pre>
  
  <p>How it should be right?</p>
  
  <p>Put and accumulate everytime rewrite all previous values, but i would like to append this object:</p>
  
  <pre><code>{
       "lat":"value",
       "lon":"value"
    },
  </code></pre>
  
  <p>Into results parent.</p>
  
  <p>BTW: I would like to do it without GSON.</p>
  
  <p>Thanks for any help..</p>