Android webview loading data performance very slow

I think the following works best:

if (Build.VERSION.SDK_INT >= 19) {
    webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
else {
    webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

Android 19 has Chromium engine for WebView. I guess it works better with hardware acceleration.

For more info Android 4.4 KitKat, the browser and the Chrome WebView

Hardware Acceleration also do’s the trick.You can use it in different levels in your application.

Application level

<application android:hardwareAccelerated="true" ...>

Activity level

<application android:hardwareAccelerated="true">
    <activity ... />
    <activity android:hardwareAccelerated="false" />

Window level


View level

myView.setLayerType(View.LAYER_TYPE_HARDWARE, null);

But as already mentioned in your question can you elaborate the side effects for this ?

Leave a Comment