Android HTTP get methods
I have written a number of applications for blackberry and am just starting in Android. It seems to me that android has a lot more built in functions. I am starting by recreating some of my BB apps on Android and on one I take a few xml sites and parse them out. On blackberry I implemented this by creating a class that extended a thread. I would construct a new instance of this class with the parameters of my http request and it would call a function back in my main class, sending i开发者_JAVA技巧t the results. I am tempted to reuse my code, but am curious if android has something better built in. I have been looking at the handler class as well as possible using a service.
Bascially, I would like to start a new thread that will return a document of a specific url.
Thanks!
Look at HttpClient and AsyncTask
You mean get a request? Refer to this
http://hmkcode.com/android-internet-connection-using-http-get-httpclient/
And see 'Using AsyncTask' (unless you use the earlier API
For me, it work
精彩评论