Android SDK Guide
This guide provides detailed instructions for integrating the Scanovate Colombia SDK into your Android application, enabling robust identity validation processes through facial biometric verification.
Requirements and Compatibility
Before starting the integration process, ensure your development environment meets the following requirements:
- Android Studio: The latest version is recommended for optimal compatibility.
- Minimum SDK Version: Android SDK version 21 (Lollipop) or higher.
- Target SDK Version: Android SDK version 34 (Android 14) to ensure your app is compatible with the latest Android OS.
- Compile SDK Version: Android SDK version 34.
Installation
1. Add the library
Download the "scanovate_colombia_@latest.aar" library and add it to your project's libs
folder. Ensure you configure your project's build.gradle
file to include the library as a dependency:
dependencies {
implementation(name: 'scanovate_colombia_@latest', ext: 'aar')
}
2. Import Required Libraries
Add the following imports in your activity or fragment where you intend to use the Scanovate SDK:
Java
import mabel_tech.com.scanovate_demo.ScanovateHandler;
import mabel_tech.com.scanovate_demo.ScanovateSdk;
import mabel_tech.com.scanovate_demo.model.CloseResponse;
import mabel_tech.com.scanovate_demo.network.ApiHelper;
import mabel_tech.com.scanovate_demo.network.RetrofitClient;
The CloseResponse
object will contain the results of the transaction, providing detailed feedback on the validation process.
Example Implementation
For a practical example of how to implement the Scanovate SDK in your Android application, refer to the following steps:
- Setup UI Elements: Initialize buttons, text views, and other UI elements in your activity's
onCreate
method. This setup includes buttons for starting the enrollment and verification processes, a text view for displaying results, and an edit text for user input. - Invoke the SDK: Use the
ScanovateSdk.start
method to launch the Scanovate SDK. This method requires several parameters, including language, project name, API key, product ID, and the SDK URL. It also allows you to specify the type of capture (e.g., liveness detection, document capture) and whether to capture the front or back side of a document. - Handle Callbacks: Implement
ScanovateHandler
to manage success and failure callbacks. On success, process theCloseResponse
object to display the transaction result. On failure, handle errors accordingly.
Example
// Example capture method implementationScanovateSdk.start( this, // Contex "1", // documentType 1, //productId "1", //RiskId "https://api-qa.ado-tech.com/api/EventTracer/", //Url_TracerBackendServices customerID, //CustomerID (CID) sessionID, //SessionID (SID) "LuloBankQA", //projectName "F99264E00A2FEA7", //apiKey "https://adocolumbia.ado-tech.com/LuloBankQA/api/", //UrlBase numberIdentification, //numberIdentification ImmersiveMode, // Inmersive Modo verification, //verification "admin", //userName "0f2ebb2d8b575d53251ba6704f762cd789bb592b", //password object : ScanovateHandler { override fun onSuccess(response: CloseResponse?, code: Int, uuidDevice: String?) { // Respuesta las salidas del SDK } override fun onFailure(response: CloseResponse?) { // Respuesta las salidas del SDK } } )
Parameters Explained
- projectName: Unique identifier for your project.
- Context: Context of the activity from which the SDK application is launched.
- apiKey: Authentication key provided by Scanovate.
- productId: Identifies the specific Scanovate product/service being used.
- sdkUrl: The base URL for making API calls to the Scanovate services.
- Url_TracerBackendServices: Url for the event reporting service is not required and is only an extra service. (Optional)
- ImmersiveMode: Mode to make the component consume all available space while hiding the system UI.
- Process_ID: Process identifier to perform the events mapped at the SDK level. (Optional)
- Verification: A parameter used to perform validation or verification within the system.
- UserName: The username or identifier required for authentication using the OAuth 2.0 protocol.
- Password: A password that has been hashed using the SHA-1 encryption algorithm for secure storage or validation.
- CustomerID: client identifier (Optional)
Process Transaction Results
After capturing the necessary data, use the RetrofitClient
to send the data for validation and display the final state of the transaction to the user.
The SDK will complete the transaction when it is part of an enrollment process. It will return a stateName
with a pending status code, which can be accessed using the following in Java:
Or using Kotlin properties:
With these values, the transactionId
will be obtained. This transactionId
should be used to verify the final information by invoking the ValidationId service to query the final transaction result.
In the case of a verification process, the system will respond with a stateName
indicating that the person is already registered, assigning state 14.