Integrating the Android framework into your app
Last updated
Was this helpful?
Last updated
Was this helpful?
Before you integrate the Android framework into your app:
Contact for a card reader and a public key.
Locate the required .jar files in the folder.
Follow these instructions to configure an Android Framework for your app:
Add the PublicOnReceiverListener
interface object to communicate back with your Android app.
Add the ApplicationContext
interface object in your project for 2 in 1 mode (DIP/SWIPE).
Add the ApplicationContext3In1
interface object in your project for 3 in 1 mode (CONTACTLESS/DIP/SWIPE).
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.
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 Clearent’s system based on the Android device in use. Peripheral specifications, such as the baud rate, vary across different Android devices.
If Clearent 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 Clearent’s SDK Android Framework.
Add the registerListen()
method to register the card reader connected using the Bluetooth settings.
Add the isReady()
method to get notifications after connecting the card reader successfully.
Do not use the card reader until the public listener calls the isReady()
method.
Add the device_startTransaction()
method to start the card data process for the payment transaction.
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.