Htmlunit on Android application

落花浮王杯 提交于 2019-11-29 13:26:33

xml-apis-1.3.04.jar contains core classes. You have to modify the jar and delete those classes.

Please note that, at least in current ADT version, you are getting a message explaining the problem:

Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.

Just as ULsies stated in the comments Htmlunit does this ==> HtmlUnit is a "GUI-Less browser for Java programs". It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc... just like you do in your "normal" browser.

which is exactly similar to webview widget provided inside the android sdk you dont need any other extra jar to open a web page inside your activity

as per google android documentation A WebView is a View that displays web pages.It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history, zoom in and out, perform text searches and more.

add this to your activity layout xml file.

    <WebView  xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
  />

and this to your activity class file..

WebView myWebView = (WebView) findViewById(R.id.webview);
 myWebView.loadUrl("http://www.your url .com");

more on this here: http://developer.android.com/guide/webapps/webview.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!