[Phonegap+sencha Touch] Mobile Development 35 Let Phonegap's WebView (Android) use chromium kernel

Source: Internet
Author: User

It should be known that Phonegap/cordova (Android) just added a shell to WebApp, that is WebApp run on WebView.

Android's WebView is a webkit kernel, but there is a difference between the WebView and the mobile chrome kernel. People who have used the mobile version of Chrome can obviously feel that performance is much smoother than their own browser (or WebView).

Android 4.4 and above with the webview is already the chromium kernel, and below 4.4 is not. So when Android 4.4 uses phonegap packaged apk, it will feel faster than the version 4.4, and HTML5+CSS3 support is also better.

Here's a way to get your apk to come with the chromium kernel, so your apk is better for the user experience on Android phones below ~4.4 4.0 and above .

Because the mobile Chrome browser is only available for Android version 4.0 and above, the chromium kernel is only available for Android 4.0 and later.


First of all, introduce a thing called crosswalk, the following is the official website address:

Https://crosswalk-project.org/documentation/cordova.html

We can first look at the above link inside the introduction.


Steps:

1. Download Crosswalk Cordova for Android


Choose Cordova android (ARM) This can, x86 Android devices are not many. Select Stable stable version of the download, beta and canary version may have some bugs.


2, the download down the zip decompression, such as decompression to D:\crosswalk-cordova-8.37.189.12-arm


3, create a PhoneGap project, under E:\hello.

CD e:d:\crosswalk-cordova-8.37.189.12-arm\bin\create Hello Com.pushsoft.hello Hello

The command is similar to the Phonegap/cordova command, except that the beginning is not phonegap or Cordova, but D:\crosswalk-cordova-8.37.189.12-arm\bin\ Create (is the Create.bat file inside)


4, you can use Eclipse to open this Android project, debug compile what (it is recommended not to use the PhoneGap local build ... I've never tried it. You can try it)

This Android app is the chromium kernel.

Ps:

①, export unsigned apk installer, you can right-click on Project-android tools-export unsigned application package with eclipse

②, export the signed APK installer (you need to generate an Android certificate yourself), you can right-click on the project-android Tools-export signed application package with Eclipse



Here's how to put your existing PhoneGap project ("original Project") and change it to chromium kernel.

1, according to the above method, create a and your original PHONEGAP project package name, program name of the same project (as a " new Project "):

For example, my original project package name is Com.pushsoft.myapp, the program name is MyApp, then I build a new project:

CD e:d:\crosswalk-cordova-8.37.189.12-arm\bin\create MyApp com.pushsoft.myapp MyApp

2, the original project below the Cordova and cordovalib two folders deleted (or removed), and then the new project E:\MyApp the following Cordova and cordovalib two folders under the original project.

is to replace the Cordova Library with the chromium kernel with the Cordova Library of your original project.


3. Use Eclipse to open the original project after the replacement, debugging compiled export what.


Ps:

①, with chromium kernel apk bag is very big, probably will be big 16MB . This package is only available for Android 4.0 and above , 4.4 and above is not required because Android WebView after 4.4 is already the chromium kernel.

②, using the Chromium kernel PhoneGap project, when using some PhoneGap plug-ins, will be error, such as Filetransfer plug-ins.

Filetransfer plugin needs to be modified to fit, modify the method click here


--------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------

Welcome to Sencha Touch + Phonegap Group: 194182999

Joint Learning Communication (blogger qq:479858761)


Sponsorship:

1, Baidu emotional transfer, as long as pay 1 cents, you have to 10 yuan, I have 5 yuan

2, Baidu Transparent coffers, pay me 1 cents, you can sponsor me

3, Baidu Wallet pay 1 cents, get sports lottery top scraping redemption code. Send me the Redemption code, and I can sponsor me.

[Phonegap+sencha Touch] Mobile Development 35 Let Phonegap's WebView (Android) use chromium kernel

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.