0

Could someone provide the basic code to use if I want to perform a http request on android to the address "address" with the string "message" ? Also I'd like to check the server response and perform some actions if the right conditions meet , but I ' m unsure of how and when the server send back the response . My guess is that the response is gotten in a blocking function, or in an asynchronous function . Could you provide code or information on this as well ? Great thanks from a novice with too much on his head !

klaus johan
  • 4,370
  • 10
  • 39
  • 56
  • You might just want to do a search. The answer to this question looks good: http://stackoverflow.com/questions/874227/android-project-using-httpclient-http-client-apache-post-get-method – Mark B Apr 13 '10 at 16:33
  • You are right but pointing to a bad question. – Janusz Apr 13 '10 at 16:37
  • possible duplicate of http://stackoverflow.com/questions/2022170/how-to-execute-web-request-in-its-own-thread – Janusz Apr 13 '10 at 16:40
  • Yeah thanks Janusz, that looks like a much better question for him to look at. – Mark B Apr 13 '10 at 18:05

1 Answers1

0

The above refers to a more complex asynchronous way, but if you want something simple and blocking, that is basic core java - http://developer.android.com/reference/java/net/URL.html

see URL.getContent(), etc.

newton
  • 1