Use Cordova to package H5 pages for app development

Source: Internet
Author: User

All along, app development is divided into Android version and iOS version, the same app needs to write two versions, the version is different, the cost is added. Cordova's emergence is a stream of clear, it can be H5 page packaged into Android or iOS version, the implementation of Android, iOS, PC-side page unification. The content is written in H5, and the difference and cost are reduced. It supports a variety of open source plug-ins can easily achieve a number of mobile phone interface calls, no functional problems.

Operation needs to master certain Nodejs

Installation of Cordova:

Download the JDK, install the Java environment, and configure the system environment. There are tutorials on the web

Open the cmd command line, run NPM install-g Cordova, and install Cordova globally.

Test whether the Cordova is installed, continue to enter CORDOVA-V on the command line, check the Cordova version number, and if there is version information, the Cordova has been successfully installed.

New Cordova Project Cordova Create FolderName

Enter the folder for the new Cordova Project CD FolderName

New Android Project Cordova Platform add Android

New iOS Project Cordova Platform add iOS

FolderName Directory has a WWW folder, which puts its own project HTML, JS, CSS, image files. Package the code into an APK file Cordova build

Data cable Connect your phone to your computer, and your phone turns on USB debug mode. Enter the command Cordova run Android–service to install the Android package on your phone for project preview and commissioning.

Cordova features more than this, the official website has more detailed introduction, open Cordova official website. A plugin that calls phone functions or other features is included on the website. Search Cordova + keywords on GitHub can also find a lot of useful plugins. Keep on learning.

Reproduced in http://www.xiaoyuezhang.com/artical/cordova.html

Related Article

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.