- PhoneGap:Beginner's Guide(Third Edition)
- Purusothaman Ramanujam Giorgio Natili
- 306字
- 2021-07-16 13:22:28
The structure of a PhoneGap application
After creating a new project, as explained in the previous chapter, you'll see the following structure inside the project's root folder:
www
: This directory contains the source files of the application and so we will be playing a lot in this directory. It contains thecss
,js
, andimg
subdirectories, where you can place the respective files. Apart from assets such as CSS, JavaScript, and images, we will also have application-related HTML files.merges
: In this folder, you can add any platform-specific customization so you don't have to modify the source files every time you work with a project. For example, we can use this feature to use a different font style on Android devices only. The platforms that you want to override will have a specific folder similar to thewww
folder having its own CSS, JS, HTML, and image contents:merges/ |-- ios/ | '-- app.js |-- android/ | '-- app.js www/ '-- app.js
In the preceding directory structure, the global application has the
app.js
file and in themerges
directory, each platform has a separateapp.js
file. During the build process, the globalapp.js
file will be replaced with the platform-specificapp.js
file.platforms
: This directory will have platform-dependent build files. For each platform that we add to the project, we can see a subdirectory.plugins
: This is the directory where you'll find the plugins used in the project. Whenever we install new plugins, they will be added over here.hooks
: This directory can contain scripts that can be used to customize the Cordova/PhoneGap commands. This is really for advanced users where integrating with build systems and version control systems is required.config.xml
: This configuration file will have all the values specific to the application, such as application name, package name, version number, and other such configurations.
推薦閱讀
- 深入核心的敏捷開發(fā):ThoughtWorks五大關(guān)鍵實踐
- Spring 5企業(yè)級開發(fā)實戰(zhàn)
- Cocos2D-X權(quán)威指南(第2版)
- Mastering Selenium WebDriver
- 深入理解Django:框架內(nèi)幕與實現(xiàn)原理
- Android 7編程入門經(jīng)典:使用Android Studio 2(第4版)
- Oracle BAM 11gR1 Handbook
- Linux Device Drivers Development
- C語言程序設(shè)計教程
- Multithreading in C# 5.0 Cookbook
- C#程序設(shè)計教程(第3版)
- 快速入門與進階:Creo 4·0全實例精講
- Modern C++ Programming Cookbook
- Ext JS 4 Plugin and Extension Development
- ROS機器人編程實戰(zhàn)