How to make an mobile app with PhoneGap and Crosswalk
What is Crosswalk?The Crosswalk Project is open source, released under a BSD licence. The project was founded by Intel's Open Source Technology Center. One can use WebGL via three.js and webrtc
By using the Crosswalk Project, an application developer can:
- Use all the features available in modern web browsers and get over the old standard Android browser limitations..ugh
- Access the latest recommended and emerging web standards.
- Use experimental APIs not available in mainstream web browsers.
- Control the upgrade cycle of an application by distributing it with its own runtime.
- Add custom extensions to an application, to leverage platform features not exposed by Crosswalk or the standardized web platform.
Why we used it?We made a elevens 2048 game which worked great in the latest Android but
not in older versions < 4
Install the Cordova Command Line Interface (CLI)
$ npm install -g cordova //Check that the version of Cordova CLI is >= 5.0.0:
$ cordova -v
Install the Crosswalk WebView plugin
$ cordova plugin add cordova-plugin-crosswalk-webview
This adds the Crosswalk WebView cordova plugin into the app.
Build with Crosswalk WebView engine for Android
$ cordova build android
It is as simple as that.
This automatically fetches the stable Crosswalk WebView libraries from the Crosswalk Project download site (https://download.01.org/crosswalk/releases/crosswalk/android/) and build for both X86 and ARM architectures.
For example, building a HelloWorld project generates:
The Crosswalk WebView library will be embedded in your app. This adds about 18 MB to the APK size which may be a problem