0

I am looking for the easiest to way to make an Android App communicate with a PHP file. I'd prefer not to use any socket in the server. Is there a way to send POST or GET messages to the PHP using Android SDK.

Edit: I would also like to know other alternatives to HTTP requests(including the ones using Sockets).

Thanks.

Rahul Ramesh
  • 45
  • 1
  • 7
  • possible duplicate of [Make in HTTP request with android](http://stackoverflow.com/questions/3505930/make-in-http-request-with-android) – Quentin Feb 21 '12 at 17:29
  • Seems like a duplicate of this http://stackoverflow.com/questions/3505930/make-in-http-request-with-android – Pico Feb 21 '12 at 17:30
  • with androids HttpClient: http://developer.android.com/reference/org/apache/http/client/HttpClient.html – Lawrence Cherone Feb 21 '12 at 17:30
  • Thanks Quentin, Pico and Lawrence Cherone. :) I've edited the question to learn about other options too. – Rahul Ramesh Feb 21 '12 at 21:09

1 Answers1

0

You can use both DefaultHttpClient from apache-httpclient or HttpURLConnection: http://android-developers.blogspot.com/2011/09/androids-http-clients.html

My preference is the DefaultHttpClient from apache, for example: http://hc.apache.org/httpcomponents-client-ga/tutorial/html/httpagent.html

Rafael Sanches
  • 1,823
  • 21
  • 28