开发者

performing a Http request on android

开发者 https://www.devze.com 2022-12-27 06:04 出处:网络
开发者_运维知识库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

开发者_运维知识库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 !


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消