Phonegap canvas low refresh rate

I am building a canvas based web game that runs at 60fps in chrome on the desktop. It also runs at 60fps in chrome on android. I loaded it into a phonegap application and the fps meter still reads 60fps, but the screen is only getting drawn every few ticks. Is there a refresh rate limiter that is forcing the webview to only draw every once a second or so? What other things could be limiting my drawing, even when the website says its redrawing at 60fps?

  • Are there any standards for mobile device web browsers in terms of thread sleeping?
  • How do I play a sound when the screen is locked on Android in React Native?
  • Ion-scroll blurs my image when zooming in in ionic framework
  • Facebook invite in phonegap returns OK
  • Cordova javascript error: has no method startsWith Android
  • Cordova file-transfer plugin download always yields http status 401 and error code 3
  • X-Frame-Options' to 'SAMEORIGIN' in Android PhoneGap
  • Jsoup javascript button clicking
  • What's the right approach for creating an Android app?
  • Is there a way to restrict a website to display only in Android?
  • When I invoke a Java function from my Javascript code, WebView crashes. Why?
  • Parse Sending push notification to specific user from Cloud code
  • 2 Solutions collect form web for “Phonegap canvas low refresh rate”

    PhoneGap by default will use the built in default browser, which is not chrome, unless you are working with KitKat, but that is a different story.

    Now I had problems myself with the default browser even on small canvas project like getting a user signature, but that was due to low rate of touchevent fires…

    Anyway the possible solution will be to force phonegap to use WebChromeClient instead of the default one, you can do that by adding following line before the super.loadUrl call:

    appView.setWebChromeClient(new WebChromeClient());
    

    If you do force to use WebChromeClient make sure you do enable javascript, local storage if you need it and so on. Also it’s possible that some PhoneGap plugins will break. If you game is pure HTML5 than I suggest considering not using phonegap for your android version, building a simple WebView app it is quite easy in Android.

    Also if your game intend to use acceleration sensor, have a look at what is the native support for browsers: Can I Use resources

    Also I will definitely read THIS and THIS

    Hope it helped.
    Emil

    Sadly, the new Webview does not have all the same features as Chrome. One of these differences is the WebGL 3D canvas that Chrome uses. See here for a list of feature differences between the new Webview and Chrome.