この形式の json ファイルを準備する必要があります: [{x: "0", y: a},{x: "1", y: b},{x: "2", y: c}]
JSONObjects と JSONArray を使用して次の手法を実装しました。
JSONArray ac=new JSONArray();
JSONObject acontent=new JSONObject();
acontent.put("x", "0");
acontent.put("y",a);
acontent.put("x", "1");
acontent.put("y",b);
acontent.put("x", "2");
acontent.put("y",c);
ac.add(acontent);
ただし、[{x: "2", y: c}] という出力しか得られませんでした。x と y の以前の値をすべて保持するにはどうすればよいですか?