bonsoir,
je veux réaliser une application android qui va interagir avec serveur web php, j'ai essaye plusieurs fois, mais je n'ai pas pu,
est ce que quelqu'un peut m'aider.
merci d'avance:P
Version imprimable
bonsoir,
je veux réaliser une application android qui va interagir avec serveur web php, j'ai essaye plusieurs fois, mais je n'ai pas pu,
est ce que quelqu'un peut m'aider.
merci d'avance:P
Regardez les classes:
HttpClient
HttpGet/HttpPost
...
strURL = "l'url de ton script PHP"
Code:
1
2
3
4
5
6
7
8
9
10 try{ HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(strURL); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); is = entity.getContent(); }catch(Exception e){ Log.e("log_tag", "Error in http connection " + e.toString()); }
Voici un tutoriel qui va t'aider: http://mobilerie.blogspot.com/2012/0...-json-php.html