Not too long ago I wrote a very popular tutorial for integrating Crosswalk into your Ionic Framework mobile application. Since then, the guys at Ionic released version 1.3.2 of their CLI and it makes the process even easier than I had previously demonstrated.
The CLI integration is still beta and there is a lot of confusion around it, but this article should clear things up in regards to its usage.
Let’s start by creating a fresh Ionic Framework project:
ionic start IonicProject blank
ionic platform add android
ionic platform add ios
Notice in the above set of commands I included the iOS platform. Although Crosswalk has nothing to do with iOS, I left it in there to demonstrate that your application can still contain both platforms.
At this current stage, we aren’t using the Crosswalk runtime. To add it, run the following command from your Terminal or command prompt:
ionic browser add crosswalk
When you build your Android project, it will now be using the Crosswalk runtime.
By default, your binary APK file will contain both x86 and arm7 architectures. This will result in a large file size. Optionally, you can build split binary APK files with the following command:
BUILD_MULTIPLE_APKS=true ionic build android
This will result in an x86 file as well as an arm7 file.
Like mentioned in my previous tutorial, the Crosswalk runtime offers a huge performance boost to your Android application for devices that run an Android version less than KitKat 4.4.4.
Track the progress of this CLI feature because it will probably get a lot better once it is out of beta.
A video version of this article can be seen below.