Is there a possibility to enhance the rendering speed in webview? With a simple innerHTML it takes close to 1 sec to display the content although the js rendering takes a few ms. With IOS, exactly the same code is running swiftly and perfectly, even with less performant hardware.
Tested under Android: 2.3, 3.2, 4.0 (Desire HD, Galaxy Nexus, Galaxy Tab) IOS: 4, 5 (iPhones 3gs, 4)
Appreciate any helpful responses!
Enhance webView performance - disable the WebView cache to make WebView much faster. Supercharging the Android WebView - cache critical assets that drastically reduce the load time.
Using WebViews in your native application is very common these days but when it comes to performance, rendering of a WebView is quite slow. As most of the heavy lifting done by WebView is loading images.
The WebView class is an extension of Android's View class that allows you to display web pages as a part of your activity layout. It does not include any features of a fully developed web browser, such as navigation controls or an address bar. All that WebView does, by default, is show a web page.
Android WebView is a system component for the Android operating system (OS) that allows Android apps to display content from the web directly inside an application.
There are a few things you can try:
Turn on hardware acceleration by adding android:hardwareAccelerated="true"
to the application or activity tag in the Android manifest file. More info here: http://developer.android.com/guide/topics/graphics/hardware-accel.html
Modify the RenderPriority of the webview - http://developer.android.com/reference/android/webkit/WebSettings.RenderPriority.html
Optimize your javaScript and CSS to minimize the number of reflows, memory used, and DOM size - http://www.html5rocks.com/en/mobile/mobifying.html#toc-optimizations
Personally, I found that keeping the DOM as small as possible, and enabling hardware acceleration made all of the difference between an unusable app, and a fairly smooth app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With