# Configuration files

# config.xml

For projects created using the Cordova CLI, you will find the config.xml file in the root of your application.
This is a global configuration file that controls the app's behaviour.
Only the name of the app (<name>HelloWorld</name>) and the unique id (<widget id="be.thomasmore.hello" ...>) are already filled in correctly.
The other properties contain default values that should be changed before the app goes into production.

A complete overview of all properties can be found on the Cordova website.

<?xml version='1.0' encoding='utf-8'?>
<widget id="be.thomasmore.hello" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>HelloWorld</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
</widget>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

TIP

You might also want to read this summary.

Place the cursor over one of the properties for additional information. This summary is not fully compatible with the latest version of Cordova, but it gives a good idea of what is possible.

# package.json

In package.json you will find almost the same information as in config.xml. Only the key plugins is important. Each time you install an additional plugin, this plugin will be added. (See later in this course).





















 
 
 







{
  "name": "be.thomasmore.hello",
  "displayName": "HelloWorld",
  "version": "1.0.0",
  "description": "A sample Apache Cordova application that responds to the deviceready event.",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [
    "ecosystem:cordova"
  ],
  "author": "Apache Cordova Team",
  "license": "Apache-2.0",
  "devDependencies": {
    "cordova-android": "^9.0.0",
    "cordova-browser": "^6.0.0",
    "cordova-plugin-whitelist": "^1.3.4"
  },
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {}
    },
    "platforms": [
      "browser",
      "android"
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

# Exercise

Examine the possibilities of config.xml and reconfigure the HelloWorld app.

  • Adjust the author and the description of the app.
  • The page will open in full-screen for all platforms.
  • Only for Android: landscape is not allowed.
Last Updated: 6/15/2021, 2:15:43 PM