Cordova Android Crosswalk

I set out to make an Android game using Ionic (a flavor of Cordova) only to find out near the finish line that the performance was horrible on a real device. Versions of Android (>4.4) use an old native webview that has bad performance and a fraction of the awesome APIs modern web developers have come to know and love.

So I searched and searched and found a solution. Crosswalk! A build of Chromium you can package with your Cordova app. The project is managed by a Google employee and I think it's a safe bet to use until most devices are running Android 4.4 and above.

This is all great, but I found getting started to be a little complicated. So I created cordova-android-crosswalk a node tool to easily migrate your current project over to Crosswalk.

How easy you ask?

cordova-android-crosswalk

Usage

$ npm install -g cordova-android-crosswalk
$ cd ~/projects/myCordovaProject
$ cordova-android-crosswalk
$ cordova run android

Dependencies

  • Nodejs/NPM
  • Apache Cordova (3.5)
    • All Cordova dependencies and PATH variables

Crosswalk

Pros

  • Huge performance boost
  • Access to latest web APIs

Cons

  • Increases file size by 17mb
  • Adds another dependency to manage

Caveat

Using my tool pretty much solves all the difficulty of Crosswalk. The only gotcha you might run into is that your Cordova projects must use and be initially built with Cordova 3.5. You can install this version by using npm install -g cordova@3.5. This requirement is Crosswalks fault they only support Cordova 3.5 as off now.

Aside

I use Ionic and if you do too you're in luck! Ionic uses the same Cordova folder construct, which means this tool will work with Ionic out of the box. Just make sure you have Cordova 3.5 installed when building your Ionic project with ionic start myProject.