// JSON object to hold the information, which is sent to the server
JSONObject jsonObjSend = new JSONObject();
jsonObjSend.put("action", "myAction");
jsonObjSend.put("type", tipo);
Per ora è tutto ok, ma se voglio aggiungereAndroid JSONObject: aggiungere Array per il metodo put
jsonObjSend.put("elementi", arrayOfElements);
dove arrayOf elementi devono essere un array di stringhe. Come posso fare?
/** EDIT
esempio di quello che ho bisogno
{
"action": "myAction",
"type": "elementi",
"elementi": [
"3287498357",
"23472857"
]
}
Penso che non sia la soluzione per il mio problema. Aggiungo un esempio di ciò di cui ho bisogno. Guarda. Grazie –
Ohh ho frainteso. Scuse. Guarda l'aggiornamento. –
Grazie mille! Ora capisco! –