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

hinch
  • 91
  • 2
  • 12

2 Answers2

0

That's not possible. The WebView component is bound to the OS System. You could try to use a third-party library, but it will still be the native WebView or you could write your own using the Android NDK. Another reason would be that the phone specs are bad.

Murat Karagöz
  • 35,401
  • 16
  • 78
  • 107
0

try this see if its work:

add android:largeHeap="true" in your application tag in manifest

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

update

you can also add handler for a one second delay to load before show something to stop laging somehow:

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

you should of course add this lines too for java script webs and storage managing :

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

also for cookie managing:

 CookieManager.getInstance().setAcceptCookie(true);
 wbView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
HamidSayyah
  • 423
  • 3
  • 19
  • Hi, thanks for the reply. I have made the change and it may have made a slight improvement but still not great. Any other suggestions? @docbigolo – hinch Sep 21 '17 at 13:18
  • @hinch you can do somethings more.something like adding handler for a one second delay to Web View load itself.i'll update my answer for more – HamidSayyah Sep 21 '17 at 13:24
  • @hinch your welcome,if this helped you mark it for right answer ;) – HamidSayyah Sep 21 '17 at 13:31
  • thanks for the advice. I think that got even better results! – hinch Sep 21 '17 at 13:34