Android webView Learning (1)

Source: Internet
Author: User

Web browsing and user interaction interface webView
The WebView class is a view class at the java layer of the WebKit module. All Android applications that require Web browser functionality must create network resources for displaying and processing requests for this view object,

 

The generation of WebView objects mainly involves three classes: CallbackProxy, WebViewCore, and WebViewDatabases. The CallbackProxy object is the UI in the Webkit module.

The thread and WebKit class libraries provide the interaction function. WebViewCore is the core layer of WebKit and is responsible for interacting with C. The class library in the C-layer of WebKit module has been initialized, while WebViewDatabases is

The WebKit module caches data during runtime and supports data storage,

 

The following describes several important WebView methods,

AddJavascriptInterface (Object obj, String interfaceName): use the next function to bind the javaScript of an Object. This method accesses javaScript.

LoadUrl (String url): loads a URL or a local HTML file.

LoadData (String data, String mimeType, String encoding): This method is often garbled and should be used as few as possible.

LoadDataWithBaseURL (String baseUrl, String data, String mimeType, String encoding, String historyUrl): load the given data to WebView and use the provided Url as its

The basic URL of the content. Www.2cto.com

CapturePicture (): captures network images loaded by the current WebView,

Incluache (boolean includeDiskFiles): clears the resource cache.

Destriy (): destroy the current WebView.


Author: chonbj

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.