- Learning Ionic(Second Edition)
- Arvind Ravulavaru
- 296字
- 2021-07-02 23:24:30
The config.xml file
The config.xml file is a platform-agnostic configuration file. As mentioned earlier, this file consists of all the information needed by Cordova to convert the code in the www folder to the platform-specific installer.
The setting up of the config.xml file is based on W3C's packaged web apps (widgets) specification (http://www.w3.org/TR/widgets/), and it is extended to specify core Cordova API features, plugins, and platform-specific settings. There are two types of configurations that we can add to this file. One is global, that is, common to all devices, and the other is specific to the platform.
If we open config.xml, the first tag we encounter is the XML root tag. Next, we can see the widget tag:
<widget id="app.example.one" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
The id specified previously is the reverse domain name of our app, which we provided while scaffolding. Other specifications are defined inside the widget tag as its children. The children tags include the app name (which gets displayed below the app icon when installed on the device), app description, and author details.
It also consists of the configuration that needs to be adhered to while converting code in the src folder to a native installer.
The content tag defines the starting page of the application.
The access tag defines the URLs that are allowed to load in the app. By default, it loads all the URLs.
The preference tag sets the various options as name value pairs. For instance, DisallowOverscroll describes weather there should be any visual feedback when the user scrolls past the beginning or end of the document.
You can read more about platform-specific configurations at the following links:
- Android: http://docs.phonegap.com/en/edge/guide_platforms_android_config.md.html#Android%20Configuration
- iOS: http://docs.phonegap.com/en/edge/guide_platforms_ios_config.md.html#iOS%20Configuration
The importance of platform-specific configurations and global configurations is the same. You can read more about global configuration at http://docs.phonegap.com/en/edge/config_ref_index.md.html#The%20config.xml%20File.
- Java語言程序設(shè)計
- Puppet 4 Essentials(Second Edition)
- LabVIEW2018中文版 虛擬儀器程序設(shè)計自學(xué)手冊
- 程序員修煉之道:通向務(wù)實的最高境界(第2版)
- PHP 7+MySQL 8動態(tài)網(wǎng)站開發(fā)從入門到精通(視頻教學(xué)版)
- 深度學(xué)習(xí):Java語言實現(xiàn)
- 好好學(xué)Java:從零基礎(chǔ)到項目實戰(zhàn)
- 現(xiàn)代C++編程實戰(zhàn):132個核心技巧示例(原書第2版)
- H5+移動營銷設(shè)計寶典
- Access數(shù)據(jù)庫應(yīng)用教程(2010版)
- Python網(wǎng)絡(luò)爬蟲從入門到實踐
- Learning Swift
- 精通Oracle 12c 數(shù)據(jù)庫管理
- TensorFlow程序設(shè)計
- Web前端開發(fā)全程實戰(zhàn):HTML5+CSS3+JavaScript+jQuery+Bootstrap