Configuring an Android Framework for your App
Follow these instructions to configure an Android Framework for your app:
Contact Clearent for a card reader and a public key.
Locate the required .jar files in the lib folder.
Use the PublicOnReceiverListener interface object to communicate back with your Android app.
Use the ApplicationContext interface object in your project for 2 in 1 mode (DIP/SWIPE).
Use the ApplicationContext3In1 interface object in your project for 3 in 1 mode (CONTACTLESS/DIP/SWIPE).
Use the DeviceFactory interface to get an object of the device in which your app is installed.
Note: This object will be used by your Android app to interact with the card reader.
Call the device_configurePeripheralAndConnect() method to use an audio jack reader for processing the payment through your Android app.
Note: 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.
Important: 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
Call the registerListen method to register the card reader connected using the Bluetooth settings.
Call the isReady method to get notifications after connecting the card reader successfully.
Note: Do not use the card reader until the public listener calls the isReady method.
Call the device_startTransaction method to start the card data process for the payment transaction.
Note: 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.
Last updated
Was this helpful?