简体   繁体   English

如何在标准的webview中使用cca?

[英]How to use cca with standard webview?

Currently cca build android will produce two apk's for x86 and ARM (reflecting the two versions of crosswalk). 目前, cca build android将为x86和ARM生成两个apk(反映了人行横道的两个版本)。

I would like to create a third that uses the default webview, ie, to target API 19+ that already has Chromium. 我想创建第三个使用默认Webview的对象,即以已经具有Chromium的API 19+为目标。

How would I go about this? 我将如何处理? Where should I start? 我应该从哪里开始?

My first brutish instinct is to clone the whole project and package with Cordova. 我的第一个野蛮本能是克隆整个项目并与Cordova打包。 But that voice in my head is usually wrong. 但是我头脑中的声音通常是错误的。

To opt out of Crosswalk webview is simple, just add "webview": "system" to you manifest.mobile.json . 要退出Crosswalk Webview很简单,只需在manifest.mobile.json添加"webview": "system"

You can read more details in our Using Crosswalk in Chrome Apps for Mobile document. 您可以在我们的“ 在Chrome Apps for Mobile中使用人行横道”文档中阅读更多详细信息。

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. 您可能还需要为该构建设置"minSdkVersion" cordova config.xml首选项,以便在kitkit之前不使用系统Webview。 Actually, you may want to use crosswalk even on kitkat, and system webview only on Android-L (21+), but that is up to you. 实际上,您甚至可能希望在kitkat上使用人行横道,而仅在Android-L(21+)上使用系统Webview,但这取决于您。

The combined flow I would use is: Leave "webview": "system" off, and set "minSdkVersion" to 14 (ICS). 我将使用的合并流程是:禁用"webview": "system" ,并将"minSdkVersion"设置为14(ICS)。 Run cca build android --release , then copy out the two apks. 运行cca build android --release ,然后复制出两个apk。 Finally, switch to system webview and set min sdk to 19/21, and copy out the third apk. 最后,切换到系统webview并将min sdk设置为19/21,然后复制出第三个apk。 Upload all of those to the play store and test! 将所有这些内容上传到Play商店并进行测试!

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. 它不是最佳流程,但易于创建脚本以自动执行该过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM