Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
736 views
in Technique[技术] by (71.8m points)

how to use htmlunit with my android project

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Nothing of this will work because he is trying to include HtmlUnit into a android project. HtmlUnit is not compatible with android because is refernces some java.* & javax.* classes which are not available in android.

Hope there will come a version for android.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...