I’m running the same exact web app on Android under PhoneGap and under the built in Browser. The app runs fine on the built-in browser but is unbelievably slow under PhoneGap. Even basic scrolling on the page stutters under PhoneGap.
P.S. This has been asked before, but due to wording I think the original question was misunderstood.
I may have inadvertently stumbled on an answer to this. Turns out that the apps I was working on had
AndroidManifest.xml set to a really low value (i.e. my target Android version was something like 2.2). Increasing this to
14 (Android 4.0) appears to have hugely improved PhoneGap performance, at least on newer Android devices running ICS or Jelly Bean.
Setting a low
targetSdkVersion seems to disable at least some of the performance improvements introduced in newer versions of Android.
So, if you want to see a big performance boost in PhoneGap, make sure your
targetSdkVersion matches the max SDK version supported by the phone you’re testing on.
I don’t know phoneGap, but you can try these:
android:hardwareAccelerated="true"in the manifest
- If you use webview
It is counter-intuitive but you may actually need to turn off hardware acceleration for your webview. Hardware acceleration as of Android 4.0.4 does nothing for canvas and other redraw events, but actually removes CPU resources for those events.
Try adding this line of code in your app java file:
Also set android:hardwareAccelerated=”false” in the manifest.
Same exact thing I experienced! Previously I was using Android 3.x for testing. As soon as I upgraded to 4.4.2 my Canvas was dead slow! Looking at the Rendering timeline I could see many Rasterization calls taking over 100ms and reducing my FPS to about 8! android:hardwareAccelerated=”false” solved my issues. Is there a way to set hardwareAccelerated=”true” depending on android version?