config.xml
The config.xml
file is a settings file controlling various settings of Cordova.
Below are available elements and preferences you may need to configure:
<widget> element
Attribute | Type | Default Value | Description |
| String |
| A version number which is visible to users |
| String | (Automatically set) When | An internal version code. It is used only to determine whether one version is more recent than others. Higher number indicates a more recent version. This version number is not shown to users. |
Example
<content> element
Attribute | Type | Default Value | Description |
| String |
| The |
Example
<access> element
Attribute | Type | Default Value | Description |
| String |
| It is used to declare access to specific network domains. If set to |
Example
<preference> element
The <preference>
tag sets various options as pairs of name/value attributes. Each preference's name is case-insensitive. Many preferences are unique to specific platforms, as listed at the top of this page. The following sections detail preferences that apply to more than one platform.
Preference Name | Type | Default Value | Description |
| Boolean |
| Determines whether Cordova will keep running in the background or not. |
| Boolean |
| Sets to true if you don’t want the interface to display any feedback when users scroll past the beginning or end of content. |
| Boolean |
| Allows you to hide the status bar at the top of the screen. |
| Number |
| Sets the default delay of how long the splashscreen appears in milliseconds. This should be the worst-case expected start time. |
| String |
| Sets the minimum log level through which log messages from your application will be filtered. There are 5 valid values such as: |
| String |
| Sets where to store Android persistent files. There are 2 valid values.
|
| String |
| (Cordova 5.2 or Higher) Sets screen orientation for devices. There are 3 valid values.
|
Example
*: If your application has previously been shipped to users, using an older (pre- 3.0.0) version of this plugin, and has stored files in the persistent filesystem, then you should set the preference to Compatibility if your config.xml
does not specify a location for the persistent filesystem. Switching the value of AndroidPersistentFileLocation
to Internal
would mean that existing users who upgrade their application may be unable to access their previously-stored files, depending on their device.
**: There are two use ways to configure ScreenOrientation
preference:
Global Settings:
Platform Specific Settings:
Specify the target API level
You can specify any target API level by using android-targetSdkVersion
in the <preference>
tag.
Last updated