android xml send and get recieve via http post

Mutiny

New Member
first I'm trying to be able to send a HttpResponse with parameters such as:\[quote\] http://www.syslang.com/frengly/cont...c=en&dest=iw&text=good&email=YYY&password=XXX\[/quote\]the code looks something like this:\[code\] DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost("http://www.syslang.com/frengly/controller"); List<NameValuePair> pairs = new ArrayList<NameValuePair>(); pairs.add(new BasicNameValuePair("src", "en")); pairs.add(new BasicNameValuePair("dest", "iw")); pairs.add(new BasicNameValuePair("text", "good")); pairs.add(new BasicNameValuePair("email", "YYY")); pairs.add(new BasicNameValuePair("password", "XXX")); UrlEncodedFormEntity entity = new UrlEncodedFormEntity(pairs,HTTP.UTF_8); httpPost.setEntity(entity); HttpResponse response = httpClient.execute(httpPost); HttpEntity httpEntity = response.getEntity();\[/code\]the API structure is available at http://www.frengly.com/ (under the API tab) and has a total of 5 parameters (src,dest,text,email,password).so far every time I tried to call \[quote\] HttpResponse response = httpClient.execute(httpPost); I keep getting an IO Exception :(\[/quote\]After that I should get something like this structure:\[code\]-<root> <text>good</text> <translation>???</translation> <translationFramed>???|</translationFramed> <missing/> <existing>good,</existing> <stat>1/1</stat></root>\[/code\]I think I'll handle from this part to build XML and parse it as I needp.s: I checked Android, send and receive XML via HTTP POST methodand many other links, which didn't help me a lot.let me know if any code lines from my application needed...Thanks in advance.
 
Back
Top