cordovaactivity使用crosswalk核心mainactivity怎么写

, May 29, 2016
Read instructions for:
Install plugin using Cordova CLI
cordova plugin add /Telerik-Verified-Plugins/Crosswalk
Install plugin using AppBuilder CLI
appbuilder plugin add "Crosswalk WebView Engine"
The Crosswalk plugin allows you to run your app on a uniform, modern webview accross various different Android versions.
you want to be sure your app renders the same on a wide range of Android devices,
you want support for the latest Web API's, even on older Android versions,
you want the fastest webview Android has to offer.
Documentation
This plugin depends on the pluggable webview architecture first introduced with Cordova-Android 4, so make sure you're using the latest Cordova bits when installing this plugin.& when in doubt.
Once installed your app will run on a recent Chromium version (Chrome 48 with plugin version 1.7.0), regardless of the Android version you're running your app on. To verify Crosswalk is successfully installed you can simply alert(navigator.userAgent) which should include 'Crosswalk'.
If you're using version 1.4+ of this plugin, and the Native Page Transitions plugin as well, please add this to Android's config.xml:
&preference name="CrosswalkAnimatable" value="true" /&
Repository
Screenshots
Version History
Uses the latest Crosswalk 22 stable version by default
Keep compatible for Cordova-android 6.0 with evaluating Javascript bridge
1.7.2 & &Fix "xwalkVersion" variable's default value
1.7.0&&& Crosswalk updated to version 18 .
1.5.1&&& The minSdk setting in AndroidManifest.xml is now used unless it's defined in config.xml or less than 14.
1.5.0&&& Crosswalk updated to version 16, Chromium 45.
1.4.0.3& Crosswalk updated to the latest current stable version (15, Chromium 44).
1.2.0&&&& Initial version (Chromium 42).
Supported Cordova Versions
Related Products
AppBuilder Extension for Visual Studio
Extract the downloaded zip archive to a folder on your desktop.
In Microsoft Visual Studio, if your project is not loaded in the Solution Explorer, load it.
If your project structure is not expanded in the Solution Explorer, expand it.
In Windows Explorer, navigate to the folder that contains the custom plugin and select the folder.
Drag the selection to the Solution Explorer in Microsoft Visual Studio and drop it on the Plugins folder.
The folder that contains the files for your plugin is added in the Plugins folder in the Solution Explorer.
AppBuilder Windows client
In the Project Navigator, double-click Properties.
In the Plugins tab, navigate to the Custom Plugins section and expand it, if needed.
Click Import and confirm the operation.
Browse and locate the archive that you want to import in AppBuilder, select it, and click Open.
A new folder that contains the files for your plugin is added in the Plugins folder in the Project Navigator.
AppBuilder CLI
Extract the downloaded zip archive to a folder on your desktop.
Navigate to your AppBuilder project and copy the newly downloaded plugin directory into your project&s Plugins folder.
AppBuilder IDE
In the Project Navigator, right click your project and choose Manage Packages.
Choose the Plugins Marketplace tab.
Search or browse for a plugin and click Install.2302人阅读
原文地址:
国内的安卓手机品牌众多,安卓操作系统碎片化也很严重,我们使用sencha touch&开发的应用不可避免的出现了各种无解的兼容性问题。
有时候我就在想,有没有既能支持cordova,又能让我们把Chromium内核打包到应用里面的平台呢?这样就不用担心兼容性了。
最近阿赛向我推荐了Crosswalk,满足了我的愿望,不过可惜的是,Crosswalk仅支持Android4.0+。并且这个是将Chromium内核打包到了应用中,所以安装包略大一些。
Crosswalk是基于Chromium内核打造的一个跨平台HTML5运行平台,具有良好的HTML5特性支持和性能优势,目前主要Android和Tizen两个平台。
Crosswalk可以与cordova集成使用,
Crosswalk的官方网站是:
在线帮助文档:
在这里我们讲crosswalk-cordova的使用,crosswalk-cordova顾名思义就是crosswalk集成了cordova
1.环境搭建(win环境)
  a.Python
    先下载Python,下载地址:&
    安装到指定路径,例如F:\Python
    打开计算机属性——高级系统设置——环境变量
    配置环境变量&&&&&&&&
      变量: Path&&&&&&&&&&&&&&& 添加值:F:\Python
    配置完成,接下来验证配置是否成功。
    双击运行——输入cmd——回车——输入Python——回车,如果出现一堆英文,如下图所示,即表示配置成功。
& & & & & &
  b.java
    先下载JAVA,下载地址:
    安装到指定路径,例如F:\Java
    打开计算机属性——高级系统设置——环境变量(如上文)
    配置环境变量&&&&&&&&
      变量: JAVA_HOME&&&&&&&&& 值: 安装路径:F:\Java\jdk1.6.0_10
      变量: Path&&&&&&&&&&&&&&& 添加值:%JAVA_HOME%\%JAVA_HOME%\jre\bin
      变量: CLASSPATH&&&&&添加值:.;%JAVA_HOME%\lib\dt.%JAVA_HOME%\lib\tools.jar&&
    配置完成,接下来验证配置是否成功。
    双击运行——输入cmd——回车——输入javac——回车,如果出现一堆英文,如下图所示,即表示配置成功。
&&&&&&&&&&&
  c.Apache Ant
    下载Apache ant,地址:&
    解压到指定路径,例如F:\apache-ant
    打开计算机属性——高级系统设置——环境变量(如上文)
    配置环境变量&&&&&&&&
      变量: ANT_HOME&&&&&&&&& 值: 你刚解压到的路径:F:\apache-ant
      变量: Path&&&&&&&&&&&&& 添加值:%ANT_HOME%\bin&&&
    配置完成,接下来验证配置是否成功。
    双击运行——输入cmd——回车——输入ant——回车。
&&&&&&&&&& 如果没有指定build.xml就会输出:
 &&&&&&& Buildfile: build.xml does not exist! &&&&&&& Build failed
  &&&&&有指定会输出:
 &&&&&&&&BUILD SUCCESSFUL
  d.adt-eclipse
    下载adt-eclipse,地址(注:可能需要挂代理)
&&&&&&&&&&& 解压到指定路径,例如F:\adt-eclipse,运行SDK Manager.exe
& & & & & &
&&&&&&&&&& 安装下图所示文件即可满足我们的需求,其他的随意
&&&&&&&&&& 因为谷歌有时候会被墙,所以在不能访问谷歌服务器时请修改hosts文件,参考:
& & & & & &
& & & & & &
& & & & & &
    打开计算机属性——高级系统设置——环境变量(如上文)
    配置环境变量&&&&&&&&
      变量:&&&&&& ANDROID_HOME&&&&&&&&& 值:F:\adt-eclipse\sdk(以你安装目录为准,确认里面有tools和add-ons等多个文件夹)
      变量:&&&&&& Path&&&&&&&&&&&&&&&&&&&&& 添加值:F:\adt-eclipse\sdk\tools
      用户变量: PATH&&&&&&&&&&&&&&&&&&&&&&&&&& 值:%ANDROID_HOME%\platform-tools
    配置完成,接下来验证配置是否成功。
    双击运行——输入cmd——回车——输入adb——回车,如果出现一堆英文,如下图所示,即表示配置成功。
& & & & & &&
  e.node.js
    下载,地址
&&&&&&&&&&& 直接安装即可
&&&&&&&&&& 安装node.js后,双击运行——输入cmd——回车——输入
&&&&&&&&&& npm install -g git 即可安装,也可以参考安装
  g.crosswalk-cordova
    下载,地址
&&&&&&&&&&& 选择Cordova Android (ARM) 7.36.154.13下载,如图
& & & & & &&
&&&&&&&&&&& 任意解压即可,如D:\ASPX\crosswalk-cordova
2.创建项目
&&&&&&&&&&& a.双击运行——输入cmd——回车进入命令行工具中,
&&&&&&&&&&& 输入:cd /d D:\ASPX\crosswalk-cordova\bin(D:\ASPX\crosswalk-cordova就是之前我解压的目录)
&&&&&&&&&&& 注意:途中可能会报一个关于git的错误,翻译过来的意思是某个文件找不到,根据路径把对应的文件夹创建了就可以了。
&&&&&&&&&&&&b.创建项目:
&&&&&&&&&&& 输入:create D:\ASPX\HelloWorld org.crosswalkproject.sample HelloWorld (D:\ASPX\HelloWorld是项目路径 org.crosswalkproject.sample是包名 &HelloWorld是项目名称)
&&&&&&&&&&&&c.添加cordova插件:
&&&&&&&&&&&&输入:cd /d D:\ASPX\HelloWorld\cordova (D:\ASPX\HelloWorld就是项目路径,在此输入version命令可以查看cordova版本号)
&&&&&&&&&&& 在这里我们需要用 plugman install --platform android --project . \ --plugin&插件地址&这个命令来添加插件,如添加摄像机插件
&&&&&&&&&&& plugman install --platform android --project . \ --plugin&
&&&&&&&&&&&&具体插件对照表请在中查看
&&&&&&&&&&&&在sencha touch中,插件的使用和直接使用 cordova&一样
3.项目打包
&    通过上述过程生成的项目就是一个完整的安卓项目了,直接用adt-eclipse导入即可。
    &整个导入打包过程可以参考,基本没有什么变化,唯一的区别就是导入的项目中多了一个xwalk_core_library,如图所示
& & & & & & &
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:115562次
积分:1327
积分:1327
排名:千里之外
原创:19篇
转载:79篇
(2)(1)(11)(1)(1)(2)(3)(1)(5)(1)(1)(2)(1)(2)(1)(1)(1)(8)(1)(6)(16)(29)(1)cordova-plugin-crosswalk-webview on NPM - Libraries
cordova-plugin-crosswalk-webview
Changes the default WebView to CrossWalk
View on registry:
npm install cordova-plugin-crosswalk-webview
Apache Cordova Crosswalk Engine
Cordova Crosswalk Engine is a
based engine to work with
for Android. This currently works with master branch of Cordova Android on GitHub, and it will work with Apache Cordova Android 4.0.0 release.
Directions:
Android-only:
Pull down the Cordova Android
$ git clone /apache/cordova-android.git
Generate a project, e.g creating HelloWorld
$ /path/to/cordova-android/bin/create hello com.example.hello HelloWorld
Navigate to the project folder
$ cd hello
Install Crosswalk engine plugin by plugman (version &= 0.22.17)
$ plugman install --platform android --plugin /MobileChromeApps/cordova-crosswalk-engine.git --project .
$ ./cordova/build
The build script will automatically fetch the Crosswalk WebView libraries from Crosswalk project download site (https://download.01.org/crosswalk/releases/crosswalk/android/) and build for both X86 and ARM architectures.
For example, building HelloWorld generates:
/path/to/hello/build/outputs/apk/hello-x86-debug.apk
/path/to/hello/build/outputs/apk/hello-armv7-debug.apk
Cordova CLI:
(It will be updated after cordova-android 4.0.0 release with CLI)
Install the latest version of the Cordova CLI from npm (version &= 4.2.0)
$ npm install -g cordova
Create a project with cordova create, e.g creating HelloWorld
$ cordova create hello com.example.hello HelloWorld
Navigate to the project folder
$ cd hello
Add the Android platform @4.0.0-dev
$ cordova platform add /apache/cordova-android.git
Add the Crosswalk engine plugin
$ cordova plugin add /MobileChromeApps/cordova-crosswalk-engine.git
$ cordova build android
The build script will automatically fetch the Crosswalk WebView libraries from Crosswalk project download site (https://download.01.org/crosswalk/releases/crosswalk/android/) and build for both X86 and ARM architectures.
For example, building android with Crosswalk generates:
/path/to/hello/platforms/android/build/outputs/apk/hello-x86-debug.apk
/path/to/hello/platforms/android/build/outputs/apk/hello-armv7-debug.apk
Note that it is also possible to publish a multi-APK application on the Play Store that uses Crosswalk for Pre-L devices, and the (updatable) system webview for L+:
To build Crosswalk-enabled apks, add this plugin and run:
$ cordova build --release
To build System-webview apk, remove this plugin and run:
$ cordova build --release -- --android-minSdkVersion=21
GitHub Repository
Proof of Concept Third Party Web Engine using Crosswalk
Created: April 23,
Last updated: March 26,
Last pushed: March 25,
Size: 115 MB
Open issues:
Top Contributors
- March 25,
Related Projects
Run Chrome Apps on mobile using Apache Cordova
8 days ago
- 2,226 stars
Deprecated. See README.md
10 months ago
A tool to take the pain out of developing and updating cordova plugins by syncing changes you mak...
11 months ago
Generator for Crosswalk Android apk packages
10 months ago
- 11 stars
grunt task for packaging apps into apk files
11 months ago
helps you find new open source libraries, modules and frameworks and keep track of ones you depend upon.
Currently tracking
open source projects
from across
platforms.

我要回帖

更多关于 cordova activity 的文章

 

随机推荐