how to use htmlunit with my android project

android, htmlunit

Solution

sorry, i have lost all my hope on HTMLUNIT. :( to gain my goal i have used HttpUrlConnection & Jsoup ... that works for me. here is my procedure i have post my code in answer.

Problem

I have downloaded htmlunit 2.11 zip. i have extract it. then i have tried to paste them in my project's libs folder. from the libs folder i have added them in build path. then i get this error, while i was trying to run my app `conversion to dalvik format failed with error 1` then, from stackoverflow i found that, one said to delete `xalan` `xercesImpl` `xml-apis`. i deleted them. but getting this error: `Error generating final archive: Found duplicate file for APK: about.html` error message also showed that which files are conflicted. they are `jetty-http` `jetty-io` `jetty-util` `jetty-websocket` then i run my app again. this time it shows some warning. i have ignored them. but my app crash saying that `classNotFound` by the way, i have also deleted `httpclient` jar. because one said that `httpclient` is already built in android. this is my problem. Now, can anyone help me? i really want to use htmlunit in my app Edited: it will be very helpfull if you show me the steps, 'how to add htmlunit in my project' Edited 2: mainly i have a link, which i have get after login (i have login through web view) this link give me a simple page. in that page there is a textarea and a submit button. and there are some javascript too (i think these javascript run, when i press the submit button). i can do it through webview, but for some reason i don't want to use webview. whene i press submit button, it deliver the value of textarea and some value of hidden field with existing cookies(which are get when i logged in through webview) Post method. i need to do this without webview. now is there any other option beside htmlunit ?? i heard about HttpClient, HttpUrlConnection. one more thing, agter submitting it will redirect me to another page. i don't need to do anything with this redirected page. N.B: if this question is not appropriate with what i really ask previously, then you can suggest me, and i will post a new question. thank you

Original source