> 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/tokenization/integrate-in-app-id-and-v/integration-with-an-android-based-device.md).

# Integration with an android-based device

### Configure your payment network TSP

The TSP configuration depends on the TSP itself. Please check wiht the TSP.

For example, Google Pay provides a guidance about how to configure those parameters, please refer to Google Pay's [TSP Settings](https://developers.google.com/pay/issuers/tsp-integration/app-to-app-idv#tsp_settings).

In general, provide these parameters to your payment network TSP.

* **Package name** (applicationId). Identifies the issuer application that Google Pay calls. If the app is not installed, the End User is prompted to install it from Google Play.
* **Action** (fully qualified). Used by Google Pay to create an explicit Android `Intent`. Keep it specific to token activation.

The so called "**extra text"**, a Base64-encoded data passed in `EXTRA_TEXT`, it is a JSON object created by the TSP and treated as a opaque object by the digital wallet, passed as it is through the through the issuer application interface.

### Implement the issuer application handler

When an End User selects app-to-app ID\&V, your issuer application must:

**Receive the Intent**

The issuer application is called using the package name, action, and `EXTRA_TEXT` provided through the payment network TSP.

**Authenticate the End User**

Perform your standard authentication inside the issuer application.

**Activate the digital card**

Decode `EXTRA_TEXT` to identify and activate the digital card.

**Return to the Digital Wallet**

Call `activity.setResult(RESULT_OK, ...)` to return the result to the Digital Wallet.

### **Receiving the Intent**

To receive the Intent from the Digital Wallet, update the Android manifest file and create an activity context to activate the token.

Example manifest entry:

```xml
<activity android:name=".CardActivationActivity">
    <!-- This activity handles App To App ACTIVATE_CARD action -->
    <intent-filter>
        <action android:name="com.example.mybank.action.ACTIVATE_CARD"/>
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
</activity>
```

### **Validate requests from the Digital Wallet**

After receiving the Intent, the issuer application can use the `Activity.getCallingPackage()` API to validate that the request is coming from the Digital Wallet.

For example, in case of Google Pay, the bellow sample code can be used:

```java
// Validate caller is Google Pay (Google Play Services)
if ("com.google.android.gms".equals(getCallingPackage())) {
    // Proceed with activation
} else {
    // Abort operation: handle error
}
```

This it implies, however, that the issuer application knows in advance which digital wallet can trigger it.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.payments.thalescloud.io/tokenization/integrate-in-app-id-and-v/integration-with-an-android-based-device.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
