Use The Ionic CLI To Integrate Crosswalk Into Your Project

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
cd IonicProject
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.

Nic Raboy

Nic Raboy

Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand.

Search

Follow Us

Subscribe

Subscribe to my newsletter for monthly tips and tricks on subjects such as mobile, web, and game development.

Subscribe on YouTube

Support This Site