如何可以使用HtmlUnit,与我的Android项目 [英] how to use htmlunit with my android project
问题描述
我已经下载了2.11的HtmlUnit拉链。我有解压。然后我试图将其粘贴在我的项目的libs文件夹中。从libs文件夹我已经在构建路径中添加他们。然后我得到这个错误,当我试图运行我的应用程序
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
转换成Dalvik的格式失败,出现错误1
那么,从计算器我发现,一说要删除的Xalan
xercesImpl
XML -apis
。
我删除它们。但得到这个错误:
then, from stackoverflow i found that, one said to delete xalan
xercesImpl
xml-apis
.
i deleted them. but getting this error:
错误产生最终的归档文件:找到重复的文件APK:about.html
错误信息还显示,该文件是冲突的。他们是码头-HTTP
码头-IO
码头-UTIL
码头-的WebSocket
然后我重新运行我的应用程序。这一次,它显示了一些警告。我已经忽略了他们。但我的应用程序崩溃说, ClassNotFound的
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
顺便说一句,我也删除的HttpClient
罐子。因为一个说的HttpClient
已经内置在Android中。
by the way, i have also deleted httpclient
jar. because one said that httpclient
is already built in android.
这是我的问题。现在,任何人都可以帮我吗?我真的希望可以使用HtmlUnit,我的应用程序
this is my problem. Now, can anyone help me? i really want to use htmlunit in my app
编辑:
如果你告诉我的步骤,这将是非常有益的,如何添加在的HtmlUnit我的项目
it will be very helpfull if you show me the steps, 'how to add htmlunit in my project'
编辑2:
主要是我有一个链接,我已经登录后得到(我已经通过网络查看登录)此链接给我一个简单的页面。在该页面有一个文本区域和一个提交按钮。并有一些JavaScript太(我想这些JavaScript的运行,当我preSS提交按钮)。我可以通过web视图做到这一点,但由于某些原因,我不希望使用web视图。 whene我preSS提交按钮,它提供textarea的价值和隐藏字段与现有的cookie(这是得到,当我登录过的WebView)Post方法有一定价值。我需要做的这一点没有web视图。现在身边有任何的HtmlUnit其他选择?我听说过的HttpClient,HttpURLConnection的。还有一件事,agter提交将我重定向到另一个页面。我不需要用这个重定向的页面进行任何操作。
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.
注:,如果这个问题不适合与什么我真的问previously,那么你可以建议我,我将发布一个新的问题。谢谢
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
推荐答案
对不起,我已经失去了所有的希望寄托在的HtmlUnit。 :(以获得我的目标我已经使用的HttpURLConnection和放大器; Jsoup ...这对我的作品<一个。 href="http://stackoverflow.com/questions/14925061/how-to-get-all-cookies-or-cookies-url-from-android-webkit-cookiemanager/#14927665">here是我的程序我有我的后code的答案。
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.
这篇关于如何可以使用HtmlUnit,与我的Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!