> For the complete documentation index, see [llms.txt](https://docs.xplorpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xplorpay.com/guides/mobile-emv/android-framework/integrate-android-framework.md).

# Integrate Android framework

{% hint style="success" %}
Before you integrate the Android framework into your app:

* Contact [Xplor Pay](https://xplorpay.com/getting-started/) for a card reader and a public key.
* Locate the required .jar files in the [android-idtech-sdk/sdk/lib](https://github.com/clearent/android-idtech-sdk/tree/master/sdk/lib) folder.
  {% endhint %}

To integrate the Android framework into your app:

{% stepper %}
{% step %}
Add the `PublicOnReceiverListener` interface object to communicate back with your Android app.
{% endstep %}

{% step %}
Add the `ApplicationContext` interface object in your project for 2 in 1 mode (DIP/SWIPE).
{% endstep %}

{% step %}
Add the `ApplicationContext3In1` interface object in your project for 3 in 1 mode (CONTACTLESS/DIP/SWIPE).
{% endstep %}

{% step %}
Add the `DeviceFactory` interface to get an object of the device in which your app is installed.

This object enables your Android app to interact with the card reader.
{% endstep %}

{% step %}
Add the `device_configurePeripheralAndConnect()` method to use an audio jack reader for processing the payment through your Android app.

The `device_configurePeripheralAndConnect()` method retrieves an audio jack peripheral configuration from Xplor Pay's system based on the Android device in use. Peripheral specifications, such as the baud rate, vary across different Android devices.

{% hint style="warning" %}
If Xplor Pay does not support an audio jack peripheral configuration for your Android device, use the .xml file as a fallback based on the IDTech format. Insert the file location into the ApplicationContext interface object. Refer to the .xml file in the xml folder available in SDK Android Framework.
{% endhint %}
{% endstep %}

{% step %}
Add the `registerListen()` method to register the card reader connected using the Bluetooth settings.
{% endstep %}

{% step %}
Add the `isReady()` method to get notifications after connecting the card reader successfully.

{% hint style="warning" %}
Do not use the card reader until the public listener calls the `isReady()` method.
{% endhint %}
{% endstep %}

{% step %}
Add the `device_startTransaction()` method to start the card data process for the payment transaction.

{% hint style="warning" %}
The initial connection to the card reader may take some time as the configuration is applied to the reader’s flash memory. Once your app starts and connects to the card reader, no further configuration is required. A flag in the local storage prevents any additional configurations.
{% endhint %}
{% endstep %}
{% endstepper %}


---

# 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:

```
GET https://docs.xplorpay.com/guides/mobile-emv/android-framework/integrate-android-framework.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.
