1

I may be in a bit of a unique situation however I am running Android 4.4 on a rooted Odroid xu4. I have developed a very basic web viewer application for android. I have installed it onto a OnePlus 5 and it works perfectly smooth. However on the Android 4.4 device the web page is very slow and lags. I have tried to enable android hardware acceleration and that hasn't done it. I understand that 4.4 KitKat version of Android runs off of a different version of web viewer.

I dont know if a possible solution would be, to somehow, update the web viewer without updating the entire OS. (Updating the entire OS is not an option for me.)

Hope someone can help or has any suggestions, all is appreciated. Thanks

4

2 回答 2

0

那是不可能的。该WebView组件绑定到操作系统系统。您可以尝试使用第三方库,但它仍然是本机 WebView,或者您可以使用 Android NDK 编写自己的库。另一个原因是手机规格不好。

于 2017-09-21T13:12:12.480 回答
0

试试这个看看它是否有效:

android:largeHeap="true"在清单中添加您的应用程序标签

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

更新

您还可以添加处理程序以延迟一秒加载,然后再以某种方式停止延迟:

 new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            wbView.loadUrl(URL);
        }
    }, 1000);

您当然也应该为 java 脚本 Web 和存储管理添加这些行:

 wbView.getSettings().setJavaScriptEnabled(true);
 wbView.getSettings().setDomStorageEnabled(true);

也用于 cookie 管理:

 CookieManager.getInstance().setAcceptCookie(true);
 wbView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
于 2017-09-21T13:14:35.877 回答