How to build a cross-platform Nulltouch framework based on Cordova

Source: Internet
Author: User
Tags resource

There is an early idea to implement a Cross-platform framework based on Cordova.

Pretend that the framework, of course, have a better set of ideas and a clearer design goals.

Design objectives:

Use pure Front-End Code (HTML+CSS+JS) to compile into native applications across platforms. However, the goal is to be achieved gradually, so here is a general idea of how to build:

1. Front-End control implementation (layout style, etc.), the use of sophisticated front-end components (bootstrap jquery zepto, etc.), the middle layer of JS encapsulation, the final output result should be a Web form of front-end files (*.html,*.css,*.js).

2.native code development and the use of Cordova Plug-ins. Although, Cordova support multiple platforms, but due to a variety of unexplained reasons, the temporary plan to support only Android and iOS platform, in addition, I dick Wire, can't afford Mac equipment, so, The iOS component may be behind Android.

3. Implementation of a debugging tool, you can access and debug the first step of the product. There are some examples of calls built in.

4. Automate compilation, which is only considered when the previous two sections are strong enough. Fortunately, the new version of Cordova has already provided enough functionality for the time being.

Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/

I don't know how many blogs this series can write, I hope not TJ, in addition, when the first step has some results, at least to achieve the front-end control and style can meet the basic characteristics of the mobile end (such as moving the end of the layout, list, basic control), it will open source.

This series assumes that readers are aware of:

1. Basic knowledge of the front end (HTML,JS,CSS)

2.cordova Fundamentals

3.android and iOS related knowledge

The use of 4.nodejs,npm,git

The development environment is no longer set up here, but in passing mention the installation of Cordova and the corresponding project:

Android:

NPM install-g Cordova

Cordova Create LZW Com.lzw.nulltouch LZW

CD LZW

Cordova Platform Add Android

Ios:

NPM install-g Cordova

Cordova Create LZW Com.lzw.nulltouch LZW

CD LZW

Cordova Platform Add iOS//can be built using Android project, CD into the appropriate path to execute this sentence can be

The Android platform's resource files are saved in./platforms/android/assets/www

The resource files for the iOS platform are saved in./platforms/ios/www

All of the page icon JS files are saved in the above two paths, note that the project is not the WWW, of course, manually set up project files can be directly opened in the project.

The Android project can use Eclipse's import capabilities, while iOS can be found under platfoms/ios/. xcodeproj files are started directly.

Here's what to note: The project's resource file (HTML,JS,CSS) path:

Android in./platforms/android/assets/www

iOS in./platforms/ios/www

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.