> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/get-started/configuration/3.-application-manifest-file.md).

# 3. Application manifest file

Configure `AndroidManifest.xml` so the NFC Wallet SDK can run correctly.

### Android permissions

Declare the following permissions in `AndroidManifest.xml`:

<table data-full-width="true"><thead><tr><th width="338.25">Android permission</th><th width="167.75">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><code>android.permission.INTERNET</code></td><td>Required</td><td>Enable network calls (for example, enrollment and payment key replenishment).</td></tr><tr><td><code>android.permission.NFC</code></td><td>Required</td><td>Enable NFC access for contactless payment.</td></tr><tr><td><code>android.permission.USE_BIOMETRIC</code></td><td>Conditional</td><td>Enable biometric authentication as CDCVM.</td></tr><tr><td><code>android.permission.USE_FINGERPRINT</code></td><td>Conditional</td><td>Support Android 9 and earlier when using biometrics as CDCVM.</td></tr></tbody></table>

### Declare NFC features

For contactless payment, the device must support:

* `android.hardware.nfc`
* `android.hardware.nfc.hce`

#### Option A: Filter unsupported devices in Google Play

Declare both features as required:

```xml
<uses-feature android:name="android.hardware.nfc" android:required="true" />
<uses-feature android:name="android.hardware.nfc.hce" android:required="true" />
```

{% hint style="warning" %}
`uses-feature` declarations filter your application in Google Play to compatible devices only.
{% endhint %}

#### Option B: Allow install and check at runtime

If you cannot filter device compatibility in Google Play, check feature support using the Android APIs:

```java
public static boolean doesDeviceSupportHCE(@NonNull final Context context) {
    final PackageManager pm = context.getPackageManager();
    final boolean hasNfc = pm.hasSystemFeature(PackageManager.FEATURE_NFC);
    final boolean supportsHce = pm.hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION);
    
    if (!hasNfc || !supportsHce) {
        // The device does not support NFC or HCE.
        return false;    
    }
    return true;
}
```

### Enable CPS communication service

Enable `CPSCommService` to process **CPS** message communication.

```xml
<!-- CPS communication service -->
<service
    android:name="com.gemalto.mfs.mwsdk.provisioning.push.CPSCommService"
    android:enabled="true"
    android:exported="false" />
```

### Disable backup and restore

Disable Android application backup and restore.

```xml
<application
    android:allowBackup="false">
```

### Example `AndroidManifest.xml`

This example shows the typical declarations you need. Adjust names and metadata to your digital wallet application.

```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.NFC" />
    <uses-permission android:name="android.permission.USE_BIOMETRIC" />
    <uses-permission android:name="android.permission.USE_FINGERPRINT" />

    <uses-feature android:name="android.hardware.nfc" android:required="true" />
    <uses-feature android:name="android.hardware.nfc.hce" android:required="true" />

    <application
        android:allowBackup="false">

        <service
            android:name="com.gemalto.mfs.mwsdk.provisioning.push.CPSCommService"
            android:enabled="true"
            android:exported="false" />

        <!-- Your HCE service (example) -->
        <service
            android:name=".payment.contactless.YourHostApduService"
            android:exported="true"
            android:permission="android.permission.BIND_NFC_SERVICE">
            <intent-filter>
                <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

            <meta-data
                android:name="android.nfc.cardemulation.host_apdu_service"
                android:resource="@xml/apduservice" />
        </service>

    </application>
</manifest>
```

{% hint style="info" %}
Declaration of HCE service will be described in [Implement HCE service](/nfc-wallet-sdk-android/implement-nfc-wallet/make-payment/implement-contactless-payments/1.-implement-hce-service.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/get-started/configuration/3.-application-manifest-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
