Ciao,
ho seguito il tutorial che hai indicato per accedere a un mio database MySQL su un server.
Vorrei però modificare il passaggio dei dati. Al posto di utilizzare nameValuePairs.add(new BasicNameValuePair("year","1980"));
vorrei passare un oggeto JSON.
Ho fatto così:
JSONObject json = new JSONObject();
json.put("season", season);
json.put("club", club);
json.put("championship", champSelected);
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(getResources().getString(R.string.host)+getResources().getString(R.string.downloadCalendar));
StringEntity se = new StringEntity("JSON: " + json.toString());
se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
httppost.setEntity(se);
Il mio problema é che ora non riesco a capire come posso accedere ai dati nel file php.
Se prima facevo $_REQUEST['year'] cosa devo scrivere per l'oggetto JSON?
Si può fare così o é meglio l'altro sistema?
Grazie mille!