# Android Framework

The **Mobile EMV** SDK enables Android apps to accept EMV chip card payments via Bluetooth or audio jack using the [IDTech VP3300](https://app.gitbook.com/s/ek5aF2vccbKrklw8djdB/devices/id-tech#id-tech-vp3300-reader) card reader.

### **Prerequisites** <a href="#prerequisites" id="prerequisites"></a>

To enable the Mobile EMV SDK into your iOS app, ensure you have following:

✅ API access key issued to you by Xplor Pay.

{% hint style="info" %}
Visit [Let's Get Started - Xplor Pay](https://xplorpay.com/getting-started/) to get API access key.
{% endhint %}

{% stepper %}
{% step %}

### Set up mobile card reader

To set up the mobile card reader:

1. Turn on the reader.

{% hint style="warning" %}
The reader must be fully charged before you turn it on.
{% endhint %}

2. Enable **Bluetooth** on your Android device.

{% hint style="success" %}
The reader automatically pairs with your Android device when Bluetooth is on.
{% endhint %}

3. Insert the chip side of the card into the reader’s slot and wait until the green LED flashes.

{% hint style="success" %}
This confirms a successful card read.
{% endhint %}
{% endstep %}

{% step %}

### Connect Android app

To connect your Android app to the card reader:

1. Add the required .jar files from `android-idtech-sdk/sdk/lib` in your Android project.
2. Add the `PublicOnReceiverListener` object to receive messages from the card reader.
3. Add the `ApplicationContext` or `ApplicationContext3In1` object to enable the card reader modes (DIP/SWIPE/CONTACTLESS).
4. Add the `DeviceFactory` object to connect your app with the VP3300 reader.
5. Configure the card reader.

{% code lineNumbers="true" %}

```javascript
device_configurePeripheralAndConnect();
registerListen();
```

{% endcode %}

6. Ensure the card reader is ready.

{% code lineNumbers="true" %}

```javascript
isReady(); // Wait for readiness before starting a transaction
```

{% endcode %}
{% endstep %}

{% step %}

### Process payment

To process the payment in your Android app:

1. Initiate a card transaction.

{% code lineNumbers="true" %}

```javascript
device_startTransaction();
```

{% endcode %}

2. Generate a JSON Web Token (JWT) for manual card entry.

{% code lineNumbers="true" %}

```javascript
manualCardTokenizer.createTransactionToken(manualEntry);
```

{% endcode %}

3. Use the POST method to send the transaction request to the [Mobile Payment Transactions](https://app.gitbook.com/s/j9heLdoDRsfnChUQohvj/api/payments/mobile/mobile-payment-transactions "mention") endpoint to process the payment.
   {% endstep %}
   {% endstepper %}
