# config.xml

The `config.xml` file is a settings file controlling various settings of Cordova.

![](/files/-MfbKY5mbb__idSdMAl0)

Below are available elements and preferences you may need to configure:

### \<widget> element

| Attribute             | Type   | Default Value                                                                                                                                                                                                               | Description                                                                                                                                                                                      |
| --------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `version`             | String | `1.0.0`                                                                                                                                                                                                                     | A version number which is visible to users                                                                                                                                                       |
| `android-versionCode` | String | (Automatically set) When `version` attribute is `"1.22.33"`, it will be 102233 (=1 \* 10000 + 22 \* 100 + 33). If the project uses Crosswalk, it will be `2xxxxxx` for ARM architecture and `7xxxxxx` for x86 architecture. | 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**

```markup
<widget id="com.example.helloworld" version="0.0.1" android-versionCode="7">
  ...
</widget>
```

### \<content> element

| Attribute | Type   | Default Value | Description                                                                                                                                                                                         |
| --------- | ------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `src`     | String | `indext.html` | The `<content>` element defines the app's starting page in the top-level web assets directory. You can change the starting page by changing the value of the `src` attribute to your preferred URL. |

**Example**

```markup
<widget id="com.example.helloworld" version="1.0.0">
  ...
  <content src="https://monaca.io/" />
</widget>
```

### \<access> element

| Attribute | Type   | Default Value | Description                                                                                                        |
| --------- | ------ | ------------- | ------------------------------------------------------------------------------------------------------------------ |
| `origin`  | String | `*`           | It is used to declare access to specific network domains. If set to `*`, you can access all domains from your app. |

**Example**

```markup
...
<access origin="*" />
...
```

### \<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                                                                                                                                                                                                                                                                                                                             |
| --------------------------------- | ------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `KeepRunning`                     | Boolean | `true`        | Determines whether Cordova will keep running in the background or not.                                                                                                                                                                                                                                                                  |
| `DisallowOverscroll`              | Boolean | `false`       | Sets to true if you don’t want the interface to display any feedback when users scroll past the beginning or end of content.                                                                                                                                                                                                            |
| `Fullscreen`                      | Boolean | `false`       | Allows you to hide the status bar at the top of the screen.                                                                                                                                                                                                                                                                             |
| `SplashScreenDelay`               | Number  | `3000`        | Sets the default delay of how long the splashscreen appears in milliseconds. This should be the worst-case expected start time.                                                                                                                                                                                                         |
| `LogLevel`                        | String  | `ERROR`       | Sets the minimum log level through which log messages from your application will be filtered. There are 5 valid values such as: `ERROR`, `DEBUG`, `WARN`, `INFO` and `VERBOSE`.                                                                                                                                                         |
| `AndroidPersistentFileLocation`\* | String  | `Internal`    | <p>Sets where to store Android persistent files. There are 2 valid values. </p><p></p><ul><li><code>Internal</code>: will put persistent files under the user’s application internal storage directory.</li><li><code>Compatibility</code>: will put persistent files under storage root.</li></ul>                                     |
| `ScreenOrientation`\*\*           | String  | `default`     | <p>(Cordova 5.2 or Higher) Sets screen orientation for devices. There are 3 valid values. </p><p></p><ul><li><code>default</code>: uses system default screen orientation.</li><li><code>landscape</code>: sets screen orientation to landscape mode.</li><li><code>portrait</code> sets screen orientation to portrait mode.</li></ul> |

**Example**

```markup
...
<preference name="KeepRunning" value="false" />
<preference name="DisallowOverscroll" value="true"/>
<preference name="Fullscreen" value="true" />
<preference name="SplashScreenDelay" value="10000" />
<preference name="loglevel" value="DEBUG" />
<preference name="AndroidPersistentFileLocation" value="Internal" />
<preference name="orientation" value="default"/>
...
```

**\***: 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:

1. Global Settings:

   ```markup
   <widget>
    ....
    <preference name="orientation" value="default"/>
    ....
   </widget>
   ```
2. Platform Specific Settings:

   ```markup
   <widget>
    ...
    <platform name="android">
    <preference name="orientation" value="default"/>
    </platform>
    ...
   </widget>
   ```

## Specify the target API level

You can specify any target API level by using `android-targetSdkVersion` in the `<preference>` tag.

```markup
<platform name="android">
    ...
    <preference name="android-targetSdkVersion" value="29" />
    ...
</platform>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://en.docs.monaca.io/reference/config/android/config_xml.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
