I built an android app with ionicframework and cordova.
But when i try to run on my Samsung Galaxy S4 the app is really slower than the same code in the webbrowsers of my phone.
How can i expect to have the same perfs ?
I've tried :
android:hardwareAccelerated="true"
this.appView.getSettings().setRenderPriority(RenderPriority.HIGH);
this.appView.getSettings().setPluginState(android.webkit.WebSettings.PluginState.ON_DEMAND);
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
With the last 3.6 cordova version
How can i do to have the same performance as i can see on the phone browser (with meta app-capable for example) ?
Web View is slower on both as compared to native android browser.
I read about how to increase performance of WebView by implementing Caching web resources like JS, CSS and image files. You can also static resources in your native application, and by intercepting the Resource requests you can override the default behaviour of WebView.
Beginning in Cordova 1.9, with the assistance of the CordovaActivity , you can use Cordova as a component in a larger native Android application. Android refers to this component as the CordovaWebView .
Cordova's user interface is WebView. Cordova application is compiled but it doesn't take CSS, JavaScript, or HTML code. It converts applications into specific native codes with respect to various platforms.
It's hard to tell as you haven't provided code or a sample.
If you're not using the latest Android 4.4 KitKat, chances are you're using a really old WebView.
Older versions of Android devices (4.0-4.3) use Android’s default browser, which has significantly less performance and standards compliance than modern Chrome. Using Crosswalk gives you a specific and more performant version of Chrome to use on all Android devices, in order to reduce fluctuations and fragmentation among devices.
This article goes deeper in the problem and it's worth reading.
If you want to achieve the same performances you have in your web browser you can replace your web runtime using Crosswalk.
Crosswalk can be easily integrated with Cordova.
With ionic framework you can simply:
ionic browser add crosswalk
If you'd like to specify a different version of Crosswalk, run ionic browser list
to see which browsers are available and what versions. Then run:
ionic browser add [email protected]
Nick Raboy has written an interesting article which will guide you through all the step you need to take to integrate Crosswalk with Cordova + Ionic Framework.
Very helpful is the video with explains everything in a simple way.
Crosswalk can also be used in Shared Mode:
"Shared mode" allows multiple Crosswalk applications to share one Crosswalk runtime. If the runtime is not already installed in the device, it will be downloaded either from the Google Play Store, or from a download location specified by the developer. When using this feature, the Crosswalk library is not included in the application's package, making it significantly smaller.
Producing a significant smaller APK file size.
It is not yet integrated in ionic framework and There is no road map to include this feature.
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