We’re developing a cross platform app for both iOS and Android. So far the iOS version is running fairly smoothly, but the Android version is significantly slower, at time almost unusable.
The main screen is using the ion-slides control with about 15 complex slides, each with scroll areas, lots of custom CSS, with a lot of *ngIf and *ngFor to populate the view with data.
We’re currently using Ionic2@beta11, and specifying android-minSdkVersion 19 with android-targetSdkVersion 23.
Is there anyway to optimize the app for Android? Is using cordova-plugin-crosswalk-webview recommended?
Crosswalk did in fact help improve performance, especially on older Android devices. Unfortunately it does increase the size of the APK a lot, and also running into some issues with Google Play’s limited support for multiple APKs for Beta Testing, but might be a necessary evil.
Also migrating large pages, into re-usable components seemed to help improve performance a lot, especially *ngFor with lots of items.
Think one of the big bottlenecks was using ion-slides with 15+ complex slides. To help this, I added *ngIf="(slide-1 == index || slide == index || slide+1 == index)" inside each ion-slide. So a maximum of three slides is every loaded at once, the previous, current and next slide. This seemed to make a big difference, and still allowed for swiping preview of next or previous to work as expected.