how to optimize renderspeed in android webview

nonnnnn picture nonnnnn · Jan 10, 2012 · Viewed 25.7k times · Source

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!

Answer

Jonathan picture Jonathan · Jan 22, 2012

There are a few things you can try:

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.