Android webview slow Android webview slow android android

Android webview slow


It depends on the web application being loaded. Try some of the approaches below:

Set higher render priority (deprecated from API 18+):

webview.getSettings().setRenderPriority(RenderPriority.HIGH);

Enable/disable hardware acceleration:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {    // chromium, enable hardware acceleration    webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);} else {    // older android version, disable hardware acceleration    webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);}

Disable the cache (if you have problems with your content):

webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);


Adding this android:hardwareAccelerated="true" in the manifest was the only thing that significantly improved the performance for me

More info here:http://developer.android.com/guide/topics/manifest/application-element.html#hwaccel


The solution for us was the opposite. We disabled hardware acceleration on the WebView only (rather than on the entire app in the manifest) by using this code:

if (Build.VERSION.SDK_INT >= 11){    webview.setLayerType(View.LAYER_TYPE_SOFTWARE, null);}

CSS3 animations are smoother now. We are using Android 4.0.

More info here: https://code.google.com/p/android/issues/detail?id=17352