Hi I am working on one application, In that I am using Android WebView. Whenever I launch webview activity, loading data in string html format from test.txt file. test.txt f
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
Activity level
Window level
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
View level
myView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
But as already mentioned in your question can you elaborate the side effects for this ?