Domestic Android phone brands are numerous, the Android operating system fragmentation is also very serious, we use Sencha touch development of the application inevitably has a variety of non-solution compatibility issues.
Sometimes I wonder if there is a platform that supports Cordova and allows us to package the chromium kernel into the application. So you don't have to worry about compatibility.
Recently , crosswalk has recommended me to meet my wishes, but unfortunately, crosswalk only supports android4.0+. And this is the chromium kernel packaged in the application, so the installation package is slightly larger.
Crosswalk is a cross-platform HTML5 running platform based on the chromium core, with good HTML5 feature support and performance advantages, currently the main Android and Tizen two platforms.
Crosswalk can be integrated with Cordova,
Crosswalk's official website is: https://crosswalk-project.org/
Online Help documentation: https://crosswalk-project.org/#documentation
Here we talk about the use of Crosswalk-cordova, Crosswalk-cordova as the name implies is crosswalk integrated Cordova
1. Environment Construction (win environment)
A.Python
Download Python first: http://www.python.org/downloads/
Install to the specified path, such as F:\Python
Turn on computer Properties-Advanced system settings-environment variables
Configuring Environment variables
Variable: Path add Value: F:\Python
Configuration is complete, and then verify that the configuration is successful.
Double-click Run--Input cmd--Enter--input python--carriage return, if a bunch of English, as shown, that means the configuration is successful.
B.java
Download java,:http://www.oracle.com/technetwork/java/javase/downloads/index.html First
Install to the specified path, such as F:\Java
Turn on computer Properties-Advanced system settings-environment variables (as above)
Configuring Environment variables
Variable: Java_home Value: Installation path: F:\JAVA\JDK1.6.0_10
Variable: Path add Value:%java_home%\bin;%java_home%\jre\bin
Variable: CLASSPATH add Value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar
Configuration is complete, and then verify that the configuration is successful.
Double-click Run--Input cmd--Carriage return--Enter javac--carriage return, if a bunch of English, as shown, indicates a successful configuration.
C.apache Ant
Download Apache ant, Address: http://ant.apache.org/bindownload.cgi
Unzip to the specified path, for example F:\apache-ant
Turn on computer Properties-Advanced system settings-environment variables (as above)
Configuring Environment variables
Variable: Ant_home value: The path you just unzipped: F:\apache-ant
Variable: Path add Value:%ant_home%\bin
Configuration is complete, and then verify that the configuration is successful.
Double-click Run-Enter cmd--Enter--input ant--carriage return.
If no build.xml is specified, the output will be:
Buildfile:build.xml does not exist! Build failed
There is a specified output:
BUILD Successful
D.adt-eclipse
Download Adt-eclipse, Address http://developer.android.com/sdk/index.html (note: May need to hang agent)
Unzip to the specified path, such as F:\adt-eclipse, to run the SDK Manager.exe
Install the file shown to meet our needs, other casual
Because Google can sometimes be wall, so when you can not access Google Server, please modify the Hosts file, reference: http://blog.csdn.net/chinaeran/article/details/10565055
Turn on computer Properties-Advanced system settings-environment variables (as above)
Configuring Environment variables
Variable: Android_home value: F:\ADT-ECLIPSE\SDK (based on your installation directory, confirm that there are tools and add-ons and other folders)
Variable: Path add Value: F:\adt-eclipse\sdk\tools
User variable: PATH value:%android_home%\platform-tools
Configuration is complete, and then verify that the configuration is successful.
Double-click Run--Input cmd--Enter--input adb--carriage return, if a bunch of English, as shown, indicates a successful configuration.
E.node.js
Download, address http://nodejs.org/
Direct installation can
F.git
After installing node. js, double-click Run-input cmd-Enter-enter
NPM install-g git can be installed, or refer to http://blog.chinaunix.net/uid-25806493-id-3319781.html installation
G.crosswalk-cordova
Download, address https://crosswalk-project.org/#documentation/downloads
Select Cordova Android (ARM) 7.36.154.13 Download,
Any decompression can be, such as D:\ASPX\crosswalk-cordova
2. Create a project
A. Double-click Run--Enter cmd--Enter into the command line tool,
Input: cd/d D:\ASPX\crosswalk-cordova\bin (D:\ASPX\crosswalk-cordova is the directory I extracted before)
Note: There may be a bug about Git in the way, translated by means that a file can not be found, according to the path to the corresponding folder created on it.
B. Create the project:
Input: Create D:\ASPX\HelloWorld org.crosswalkproject.sample HelloWorld (D:\ASPX\HelloWorld is the project path Org.crosswalkproject.sample is the package name HelloWorld is the project name)
C. Add the Cordova plugin:
Input: cd/d D:\ASPX\HelloWorld\cordova (D:\ASPX\HelloWorld is the project path, where you can enter the version command to see the Cordova revision number)
Here we need to use Plugman install--platform Android--project. \--plugin Plugin address this command to add plugins, such as add camera plugin
Plugman install--platform Android--project. \--plugin https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git#r0.2.5
Please check the https://crosswalk-project.org/#wiki/[email protected] for specific plug-in tables.
In Sencha touch, plug-ins are used in the same way as direct use of Cordova
3. Project Packaging
Project packaging can refer to http://www.cnblogs.com/mlzs/p/3437445.html, basically no change, the only difference is that the imported project more than a xwalk_core_library,
Pack Sencha touch projects with Crosswalk-cordova and never worry about Android compatibility!