1

I want to know if anyone knows a good tutorial. I have in my app 2 edittexts with username and password. I want to write these in an xml file and send it to my server. I was thinking about a function which opens the connection, writes the xml, sends it, and waits for an answer, and this function will have two input parameters which are username and password. Please send me code suggestions :-) thanks

2 Answers 2

1

Your question has been asked before: Android, sending XML via HTTP POST (SOAP) A simple google search of: android http post xml returned that result, of course SO has a search feature too ;)

Sign up to request clarification or add additional context in comments.

Comments

1

What you want to look at is the HttpClient class. You'll probably want to do something like this:

HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("http://www.example.com/myscript");
HttpResponse response = httpClient .execute(httpPost );

And add your data using httppost.setEntity. There are plenty of code examples out there for this type of thing. A simple Google search should yield tons of information for you.

1 Comment

hey Joe maybe u can post an example with full code..i will be very thankfull

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.