Phonegap - cordova is laggy and slow on android and iOS devices

Sibi picture Sibi · Sep 16, 2013 · Viewed 15.2k times · Source

I just now started with my first PhoneGap project using zend studio. But, after i build and deploy it, the application is quite slow. Both on android and iOS. The scrolling is lagging, and if i press a button, it's slow to goto the next page. Is there any way to improve it's performance ? Thanks in advance

Answer

Peter Drinnan picture Peter Drinnan · Dec 6, 2013

Since version 4.0.4, there is a known "bug" where if hardware acceleration is on, it will actually slow down screen redraw events. This is why scrolling is slow.

On the Samsung Galaxy III and IV, canvas would not render anything at all until we turned off hardware acceleration. Once we did canvas drawing performed well.

You can turn off hardware acceleration for your webview with this line of code in your app java file:

super.appView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null);

This may be fixed as of 4.4 (KitKat uses Chromeview rather than webview).