How to use cca with standard webview?

307 views Asked by At

Currently cca build android will produce two apk's for x86 and ARM (reflecting the two versions of crosswalk).

I would like to create a third that uses the default webview, i.e., to target API 19+ that already has Chromium.

How would I go about this? Where should I start?

My first brutish instinct is to clone the whole project and package with Cordova. But that voice in my head is usually wrong.

1

There are 1 answers

0
mmocny On BEST ANSWER

To opt out of Crosswalk webview is simple, just add "webview": "system" to you manifest.mobile.json.

You can read more details in our Using Crosswalk in Chrome Apps for Mobile document.

You will probably also want to set the "minSdkVersion" cordova config.xml preference for that build, so that the system webview is not used pre-kitkat. Actually, you may want to use crosswalk even on kitkat, and system webview only on Android-L (21+), but that is up to you.

The combined flow I would use is: Leave "webview": "system" off, and set "minSdkVersion" to 14 (ICS). Run cca build android --release, then copy out the two apks. Finally, switch to system webview and set min sdk to 19/21, and copy out the third apk. Upload all of those to the play store and test!

This isn't needed during development time, just for doing releases. Its not the best flow, but its easy to create scripts to automate the process.