Android - Read an XML file with HTTP GET -
I have to search for the use of web services on Android, I know that XML - for RPC web service There is no official library.
But REST is for XML and I have to test it.
I would like to read XML on my web page (where I have to pass the username and password) from Android to GTT
OR >
Suppose I follow, then how do I pass the username and password?
Can anyone help me on this?
HTTPGreat Yuri = new HTTP gate ("http://example.com"); DefaultHttpClient Client = New DefaultHttpClient (); HttpResponse resp = client.execute (Yuri); StatusLine status = resp.getStatusLine (); If (status.getStatusCode ()! = 200) {Log D. (Tag, "HTTP error, invalid server status code:" + resp.getStatusLine ()); } DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance (); DocumentBuilder Builder = Factory. NE DocumentBuilder (); Document doctor = builder.parse (resp.getEntity (.) GetContent ());
Comments
Post a Comment