# Manipulating the Android Manifest from Cordova

Some Batch configuration requires editing `AndroidManifest.xml`.

To do so, open up your `config.xml` and scroll down to `<platform name="android">`.

There, add a `config-file` tag targeting the manifest's application tag:

```xml
<platform name="android">
  <config-file target="AndroidManifest.xml" parent="/manifest/application">
   <!-- Your manifest edits go here. These lines will be added in AndroidManifest.xml's <application> tag. -->
  </config-file>
</platform>
```

For example, adding opt-out metadata would look like:

```xml
<platform name="android">
  <config-file target="AndroidManifest.xml" parent="/manifest/application">
    <meta-data android:name="batch_opted_out_by_default" android:value="true" />
  </config-file>
</platform>
```

If your're encountering build issues, you might need to add `xmlns:android="http://schemas.android.com/apk/res/android"` in the `widget` tag attributes of your `config.xml`:

```xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova"
        xmlns:android="http://schemas.android.com/apk/res/android" ...>
```

{% hint style="info" %}
These steps are not applicable for Ionic Capacitor.
{% endhint %}


---

# 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://doc.batch.com/developer/sdk/cordova/advanced/android-manifest-manipulation.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.
