Scanner Reader SDK
Prerequisites
- The host application should be listed on DvStore
- iPOSpays-powered Dejavoo terminal
- Login credential to iPOSpays
For Sandbox (UAT):
Users should be onboarded on the iPOSpays sandbox (UAT) environment as a merchant and have a valid TPN.
For Production (Live):
Users should be onboarded on the iPOSpays production environment as a merchant and have a valid TPN.
If you do not have a TPN, contact your ISO or devsupport@dejavoo.io.
Downloading the Scanner Reader SDK
- Locate the
Peripheral_v1.0.aarfile provided with your Scanner Reader kit. - Copy the
Peripheral_v1.0.aarfile to your project directory.
Configuring Gradle Dependencies
Open your module-level build.gradle file and add the following inside the dep
Plain text
implementation files "libs/Peripheral_v1.0.aar"Synchronizing Gradle
- In Android Studio, click Sync Project with Gradle Files
- This ensures the SDK and dependencies are properly loaded into your project
Accessing the Scanner
Follow the steps below to initialize and use the scanner:
- Place the
.aarfile inside thelibsfolder of your project - Add the dependency in the app-level
build.gradlefile:
Plain text
implementation files 'libs/Peripheral_v1.0.aar'Scanner Initialization
Use the following code to initialize the scanner. After initialization, configure callbacks to handle scan success and failure.
Kotlin
private lateinit var scannerActivity: ScannerActivity
if (Build.MODEL == "P18") {
scannerActivity = ScannerActivity(this, iscanResult, SCAN_TIMEOUT)
} else {
scannerActivity = ScannerActivity(iscanResult, SCAN_TIMEOUT)
}
private const val SCAN_TIMEOUT = 30000Java
private ScannerActivity scannerActivity;
private static final int SCAN_TIMEOUT = 30000;
if (Build.MODEL.equals("P18")) {
scannerActivity = new ScannerActivity(this, iscanResult, SCAN_TIMEOUT);
} else {
scannerActivity = new ScannerActivity(iscanResult, SCAN_TIMEOUT);
}Callback Handling
Implement the callback interface to handle scan responses:
Kotlin
val iscanResult = object : IScannerResult {
override fun onSuccess(result: String) {
// Successful scan result
}
override fun onFailure(errorMessage: String) {
// Error handling
}
}Java
IScannerResult iscanResult = new IScannerResult() {
@Override
public void onSuccess(String result) {
// Successful scan result
}
@Override
public void onFailure(String errorMessage) {
// Error handling
}
};Start Scanning
Use the following code to begin scanning:
Kotlin
scannerActivity.startScan()Java
scannerActivity.startScan();Stop Scanning
Use the following code to stop the scanner:
Kotlin
scannerActivity.stopScan()Java
scannerActivity.stopScan();
Response
Example scan result:
Plain text
result: P17B4250908000566Was this section helpful?
On this page
- Scanner Reader SDK