Code example for JSONArray

Methods: puttoString

0
		return resp;
	} 
 
	public static String process_download() {
		Log.i(TAG, "process(): enviar datos al servidor");
		JSONArray elements = new JSONArray();
		Iterator<JsonData> i = adapter.iterator();
		String resp = "";
		try { 
			if (elements == null || adapter == null || adapter.size() == 0)
				return "-1"; 
			elements.put(adapter.poll().toJSON_HEADER());
			elements.put(adapter.poll().toJSON_DOWNLOAD());
		} catch (JSONException ex) {
			Log.e("Json", "JSONException", ex);
		} 
		Log.i(TAG, "process(): listo para enviar " + adapter.size()
				+ " datos al servidor"); 
 
		request = elements.toString();
		try { 
			Log.d(TAG, "send = " + request);
			resp = sendToServer(request, JSON_URI_DOWNLOAD);
			Log.d(TAG, "response: " + resp);
		} catch (Exception ex) {
Connect your IDE to all the code out there  Get Codota for Java