如何Android的web视图使用WebKit的? [英] How Android webview uses webkit?

查看:156
本文介绍了如何Android的web视图使用WebKit的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,WebKit是用于在Web浏览器中显示HTML内容的排版引擎。我看着的Webkit端口并没有发现任何有关Android的东西。我又看了看对的WebView类Android源文件夹,但我看不出web视图是关系到Webkit内核。

I know that webkit is a layout engine used for display HTML content in web browser. I looked at Webkit ports and found no stuffs related to Android. I also looked at Android source folder for WebView class, but I can't see how Webview is related to Webkit.

我想知道如何WebKit是采用的是Android的WebView,如何自定义WebKit的?

I want to know how webkit is used in Android webview, how to customize webkit ?

我也想知道在WebKit中使用的线程机制,如何使用线程池来处理布局和JavaScript(特别是针对Android)

I also want to know the threading mechanism used in webkit, how it uses thread pool for processing layout and javascript (especially for Android)

我真的很需要帮助。先谢谢了。

I really need help. Thanks in advance.

更新

我看看 WebView.java WebViewCore.java JniUtil.java 的WebKit包。特别是在 JniUtil.java

I look into WebView.java, WebViewCore.java and JniUtil.java in webkit package. Particularly in JniUtil.java there is

static {
        System.loadLibrary("webcore");
        System.loadLibrary("chromium_net");
}

在哪里的WebCore和chromium_net? 他们是否与此相关的的WebKit源

Where are webcore and chromium_net ? Are they related to this webkit source ?

推荐答案

下面的图片: Android的架构 -

the following picture: android architecture -

的WebKit位于库层上。和WebKit源是由C / C ++开发的。

webkit located on the libraries layer. and webkit source was developed by c/c++.

我认为Android的WebView连接使用JNI(Java本地接口)的WebKit。您可以查看Android源(C ++的一部分)。我认为,解决那里。

I think android webview connect to webkit by using jni (java native interface). You can view android source (c++ part). I think the solution there.

编辑:  你可以看到类<一href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android-apps/4.1.1_r1/com/android/browser/BrowserWebView.java?av=f">android.webkit.WebViewCore: 在静态构造函数:

You can see the class android.webkit.WebViewCore: On static constructor:

static {
    // Load libwebcore and libchromium_net during static initialization.
    // This happens in the zygote process so they will be shared read-only
    // across all app processes.
    try {
        System.loadLibrary("webcore");
        System.loadLibrary("chromium_net");
    } catch (UnsatisfiedLinkError e) {
        Log.e(LOGTAG, "Unable to load native support libraries.");
    }
}

我觉得你可以在WebCore的&放大器找到; chromium_net(Android源C ++)

I think you can find in webcore & chromium_net (android source c++)

更新: 我找链接<一个href="https://android.googlesource.com/platform/external/webkit/+/f10585d69aaccf4c1b021df143ee0f08e338cf31/WebKit/android/jni">jni Android的WebKit的

这篇关于如何Android的web视图使用WebKit的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆