@coen_warmer yes Crosswalk is Android 4.0 and up, the Android APIs appear to be the reason why.
As previously mentioned the beta is the better release to use. It’s Chrome 34, supports external debugging from chrome inspect (enough of a reason to use Crosswalk) and all the other nice modern apis, hello websockets and webworkers.
Latest Cordova plugins work fine, I’m using Camera, File, Device, Barcode Scanner, a custom plugin that accesses Bluetooth among others.
I’m using Crosswalk Cordova 5.34.104.4 on a Cordova project (upgraded to Cordova 3.4.1) that I use the Cordova CLI to build/debug. In short, BACKUP before doing anything:
-
I created a clean Crosswalk Cordova project (ARM version) for testing on a real device. If you use the ARM emulator it should work but I gave up on that a long time ago and use Genymotion which is x86 so substitute the x86 version if targeting that
-
Copied the cordova.js (v3.3) into the Android platform_www directory replacing the existing js (don’t need this step when they merge the pull request for 3.4 refactor)
-
Replace the existing CordovaLib with the Crosswalk Cordova project’s CordovaLib (xwalk lib is in this directory)
-
I updated any Manifests.xml to force them to be at least min 14 but it may work without doing this
-
Patched cordova/lib/build.js because, it won’t compile xwalk correctly with CordovaLib due to the custom_rules.xml.You can’t get rid of custom_rules.xml because the CLI needs the app apk to be located in the ant-build dir for launching/copying/etc to device/emulator
module.exports.get_apk = function() {
if (hasCustomRules()) {
var binDir = path.join(ROOT, 'ant-build');
}
else {
var binDir = path.join(ROOT, 'bin');
}
On the app side:
- I had CORS issues so created a manifest.json and that resolved it
- Crosswalk has orientation change issues and some devices (see tablets) annoyingly default to landscape, so I placed the following in the document ready code because I only support portrait (change approach as required).
# Ensure portrait orientation https://w3c.github.io/screen-orientation/
if window.screen?.lockOrientation?
window.screen.lockOrientation("portrait")
Hopefully this helps someone get a start.