Android - Utility Module¶
The utility module contains helper functions that are not directly related to OCR, NFC, Face, or VideoCall, but can be used in Digital Customer Acquisition (KYC/KYB) processes.
Features offered by the module:
- Call Type Listing
- Appointment System (Query / Create / Cancel)
- Document Addition
- Document Signing
- Barcode Reading
- Address Verification
- Corporate Customer Acquisition (KYB)
- Voice Verification
⚠️ Precondition: Maven access must be provided and the Core Module must be added to the project.
Adding to the Project¶
1. Add to libs.versions.toml file:¶
[versions]
...
enqualify-plus = "x.x.x.x"
[libraries]
...
enqualify-plus-utility = {
group = "com.enqualify.plus",
name = "utility",
version.ref = "enqualify-plus"
}
2. Add dependency to build.gradle.kts file:¶
3. Gradle Sync¶
Synchronize the Gradle files by clicking on the "Sync Now" option.
Implementation¶
1. Activity Layout — FrameLayout¶
<FrameLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
2. Adding the UtilityCallbacks Interface¶
Adding to the class:
Overriding the callbacks:
class EnQualifyPlusActivity : AppCompatActivity(), UtilityCallbacks {
override fun tokenCreateCompleted(isNewCreatedToken: Boolean) {
Log.i(TAG, "${object {}.javaClass.enclosingMethod?.name}")
}
override fun tokenCreateFailed(errorMessage: String) {
Log.i(TAG, "${object {}.javaClass.enclosingMethod?.name}")
}
override fun settingGetFailed(errorMessage: String) {
Log.i(TAG, "${object {}.javaClass.enclosingMethod?.name}")
}
override fun sessionAddFailed(errorMessage: String) {
Log.i(TAG, "${object {}.javaClass.enclosingMethod?.name}")
}
override fun sessionCloseCompleted(status: CallSessionTypeStatus) {
Log.i(TAG, "${object {}.javaClass.enclosingMethod?.name}")
}
override fun sessionCloseFailed(errorMessage: String) {
Log.i(TAG, "${object {}.javaClass.enclosingMethod?.name}")
}
override fun integrationAddCompleted() {
Log.i(TAG, "${object {}.javaClass.enclosingMethod?.name}")
}
override fun integrationAddFailed(errorMessage: String) {
Log.i(TAG, "${object {}.javaClass.enclosingMethod?.name}")
}
override fun initializeFailed(failureCode: FailureCode, additionalMessage: String) {
Log.i(TAG, "${object {}.javaClass.enclosingMethod?.name}")
}
override fun baseModelCompleted() {
Log.i(TAG, "${object {}.javaClass.enclosingMethod?.name}")
// SDK is ready — Utility functions can be used
}
}
3. Initializing EnQualifyUtility¶
Unlike other modules, the utility module does not take a SessionModel and does not use settings. It is only started with BaseModel:
val baseModel = BaseModel(
baseURL = "https://deveqmapi.enqura.com",
signallingCertificateList = listOf("enqura"),
mapiCertificateList = listOf("enqura"),
mobileUser = "mobile",
countryCode = "TUR"
)
EnQualifyUtility.setBaseModel(
context = this,
fragmentManager = supportFragmentManager,
containerId = R.id.fragmentContainer,
baseModel = baseModel
)
Initialization Parameters¶
| Parameter | Type | Description |
|---|---|---|
context | Context | The runtime context of the application |
baseModel | BaseModel | The model carrying server connection and certificate information |
fragmentManager | FragmentManager | Manages the fragments |
containerId | Int | The ID of the container where the fragment will be added |
When the initialization is completed, baseModelCompleted is triggered, and all utility functions become available.
General Response Model — DataModel¶
All utility functions return their results through DataModel<T>:
data class DataModel<T>(
val isSuccess: Boolean,
val data: T? = null,
val errorMessage: String? = null
)
The data field can be String, Boolean, or a custom class depending on the function.
Call Type Listing¶
Lists the active call types in the current environment. The returned code value can be set to the SessionModel.callType field.
EnQualifyUtility.getInstance().CallTypeGet(
handler = "", // Can be left empty for individual KYC; must be specified for different flows
callTypeListener = { dataModel: DataModel<ArrayList<CallType>> ->
// Results related to call types can be used here
}
)
CallType model:
data class CallType(
var code: String? = null, // Corresponds to SessionModel.callType value
var name: String? = null // The display name that can be shown to the end user
)
Appointment System¶
Used in partial application (appointment-based video calls) flow. If a partial application is to be made, SessionModel.isContinue should be set to true.
Querying Available Appointment Slots¶
EnQualifyUtility.getInstance().AppointmentAvailableGet(
callType = "NewCustomer",
startDate = "2025-09-22T08:42:26.306Z",
endDate = "2025-09-22T08:42:26.306Z",
appointmentAvailableListListener = { dataModel: DataModel<ArrayList<AppointmentAvailableListResponseData>> ->
// Available appointment slots can be used here
}
)
AppointmentAvailableListResponseData model:
data class AppointmentAvailableListResponseData(
var date: String? = null,
var startTime: String? = null,
var endTime: String? = null,
var count: Int? = null
)
Creating an Appointment¶
val appointmentSave = AppointmentSaveData(
callType = "NewCustomer",
date = "2025-09-22T08:42:26.306Z",
startTime = "2025-09-22T08:42:26.306Z"
)
EnQualifyUtility.getInstance().AppointmentSave(
appointmentSaveData = appointmentSave,
appointmentSaveListener = { dataModel: DataModel<Boolean> ->
// Appointment creation result can be used here
}
)
AppointmentSaveData model:
data class AppointmentSaveData(
var callType: String? = null,
var date: String? = null,
var startTime: String? = null,
var identityType: String? = null,
var identityNo: String? = null,
var name: String? = null,
var surname: String? = null,
var phone: String? = null,
var email: String? = null
)
Canceling an Appointment¶
EnQualifyUtility.getInstance().AppointmentCancel(
callType = "NewCustomer",
identityType = "TC Kimlik Kartı",
identityNo = "12345678910",
appointmentCancelListener = { dataModel: DataModel<Boolean> ->
// Appointment cancellation result can be used here
}
)
Querying Current Appointments¶
EnQualifyUtility.getInstance().AppointmentGet(
identityType = "TC Kimlik Kartı",
identityNo = "12345678910",
appointmentListListener = { dataModel: DataModel<ArrayList<AppointmentListResponseData>> ->
// Current appointments can be used here
}
)
AppointmentListResponseData model:
data class AppointmentListResponseData(
var uId: String? = null,
var callType: String? = null,
var callTypeValue: String? = null,
var identityType: String? = null,
var identityNo: String? = null,
var name: String? = null,
var surname: String? = null,
var phone: String? = null,
var email: String? = null,
var startDate: String? = null,
var endDate: String? = null,
var isPriorityCustomer: Boolean? = null
)
Document Addition¶
1. Listing Document Category Types¶
List the categories that can be loaded before document upload:
EnQualifyUtility.getInstance().DocumentCategoryGetV2(
subjectType = "Mobile", // Individual: "Mobile" | Corporate: "KYB"
callType = "NewCustomer",
documentCategoryGetV2Listener = { dataModel: DataModel<DocumentCategoryGetV2ResponseData> ->
// Document categories can be used here
}
)
DocumentCategoryGetV2ResponseData model:
data class DocumentCategoryGetV2ResponseData(
var category: String? = null,
var name: String? = null,
var nameEn: String? = null,
var sequence: Int? = null
)
2. Adding a Document¶
After obtaining category information, it is used to upload the document. Three pieces of information are required for each document:
| Field | Description |
|---|---|
extension | File extension (.pdf, .doc, .word, etc.) |
content | Base64 encoded content of the file |
contentHash | Hash of the content value |
val document = DocumentAddDocument(
extension = ".pdf",
content = "FileBase64Content",
contentHash = "FileBase64ContentHash"
)
EnQualifyUtility.getInstance().DocumentAdd(
category = "SürücüBelgesi", // Must be the value from DocumentCategoryGetV2 result
documents = arrayListOf(document),
documentAddListener = { dataModel: DataModel<Boolean> ->
// Document addition result can be used here
}
)
Document Signing¶
1. Setting the Signature¶
EnQualifyUtility.getInstance().SigningSet(
data = "Base64Content", // Base64 content of the document to be signed
reference = "123456789", // SessionModel.reference value
documentReference = "123456789", // Reference number of the document to be signed
signingSetListener = { dataModel: DataModel<Boolean> ->
// Signature setting result can be used here
}
)
2. Finishing the Signature¶
EnQualifyUtility.getInstance().SigningFinish(
reference = "123456789", // Must be the same as the reference used in SigningSet
signingFinishListener = { dataModel: DataModel<Boolean> ->
// Signature finalization result can be used here
}
)
Barcode Reading¶
Used to read the barcode of a document obtained through E-Government:
EnQualifyUtility.getInstance().BarcodeRead(
content = "Content", // Base64 content of the document whose barcode will be read
identityNo = "123456789", // User's Citizen ID Number
isWithAddress = true, // Whether to perform address verification with the document
barcodeReadListener = { dataModel: DataModel<VerifyBarcodeReadResponseData> ->
// Barcode reading result can be used here
}
)
VerifyBarcodeReadResponseData model:
data class VerifyBarcodeReadResponseData(
var barcode: String? = null,
var address: String? = null,
var isSameIdentity: Boolean? = null,
var expireDate: String? = null
)
Address Verification¶
Used to verify the user's address with the residence document through E-Government:
EnQualifyUtility.getInstance().AddressVerify(
identityNo = "123456789", // User's Citizen ID Number
barcode = "Barcode", // Barcode result obtained from the BarcodeRead step
addressVerifyListener = { dataModel: DataModel<Boolean> ->
// Address verification result can be used here
}
)
Corporate Customer Acquisition (KYB)¶
1. Adding a Customer¶
EnQualifyUtility.getInstance().CallBusinessAddV2(
taxNumber = "123456",
name = "FullCompanyName",
shortName = "CompanyShortName",
data = "ExtraData",
type = "CompanyType",
reference = "123456789",
callBusinessAddV2Listener = { dataModel: DataModel<CallBusinessAddV2ResponseData> ->
// callBusinessUId should be taken here — it will be used in all subsequent KYB processes
}
)
ℹ️
callBusinessAddV2Listener's returnedcallBusinessUIdis used as a mandatory parameter in all subsequent KYB services.
2. Checking Customer¶
EnQualifyUtility.getInstance().CallBusinessCheckV2(
taxNumber = "123456",
callBusinessCheckV2Listener = { dataModel: DataModel<CallBusinessCheckV2ResponseData> ->
// Customer registration status can be used here
}
)
CallBusinessCheckV2ResponseData model:
data class CallBusinessCheckV2ResponseData(
var checkRecord: Boolean? = null,
var callBusinessUId: String? = null,
var type: String? = null
)
3. Updating Customer¶
EnQualifyUtility.getInstance().CallBusinessUpdate(
callBusinessUId = "123456", // ID from the Customer Adding step
type = "CompanyType",
reference = "123456789",
isInProgress = true, // Indicates whether other KYB steps have been initiated
callBusinessUpdateListener = { dataModel: DataModel<Boolean> -> }
)
4. Adding Authorized Person¶
EnQualifyUtility.getInstance().CallBusinessStaffAdd(
callBusinessUId = "123456",
name = "StaffName",
surname = "StaffSurname",
identityNo = "123456",
birthDate = "01/01/1990",
phone = "905055055050",
callBusinessStaffAddListener = { dataModel: DataModel<Boolean> -> }
)
5. Removing Authorized Person¶
EnQualifyUtility.getInstance().CallBusinessStaffRemove(
callBusinessUId = "123456",
identityNo = "123456",
callBusinessStaffRemoveListener = { dataModel: DataModel<Boolean> -> }
)
6. Checking Authorized Person¶
EnQualifyUtility.getInstance().CallBusinessStaffCheckV2(
identityNo = "123456",
callBusinessUId = "123456",
callBusinessStaffCheckV2Listener = { dataModel: DataModel<CallBusinessStaffCheckV2ResponseData> -> }
)
7. Listing Corporate Document Categories¶
EnQualifyUtility.getInstance().DocumentKYBCategoryListV2(
documentKYBCategoryListV2Listener = { dataModel: DataModel<ArrayList<DocumentKYBCategoryListV2ResponseData>> ->
// Corporate document categories can be used here
}
)
DocumentKYBCategoryListV2ResponseData model:
data class DocumentKYBCategoryListV2ResponseData(
var category: String? = null,
var name: String? = null,
var nameEn: String? = null,
var sequence: Int? = null
)
8. Adding Corporate Document¶
val document = CallBusinessDocumentAddRequestDocument(
extension = ".pdf",
content = "FileBase64Content",
contentHash = "FileBase64ContentHash"
)
EnQualifyUtility.getInstance().CallBusinessDocumentAdd(
category = "Category", // Must be the value from the Document Category Listing step
documents = arrayListOf(document),
documentAddListener = { dataModel: DataModel<Boolean> ->
// Document addition result can be used here
}
)
Voice Verification¶
It is a module that pulls question groups defined in the back office and receives voiced answers from the user, verifying them with STT (Speech-to-Text).
1. Pulling All Questions¶
Used to initiate the voice verification flow and get the question configuration defined in the back office:
On success, the ConversationalValidationConfig callback is triggered, and the entire question list is obtained via response:
override fun ConversationalValidationConfig(response: VoiceVerificationMobileListResponse?) {
// The entire question list comes here, the flow is managed through these responses
}
override fun ConversationalValidationConfigFailed() {
// Question configuration could not be obtained
}
note512811e3
*The question list comes in the format of the following models.*
VoiceVerificationMobileListResponse model:
data class VoiceVerificationMobileListResponse(
var isSuccessful: Boolean,
var referenceId: String,
var data: List<VoiceVerificationContent>
)
VoiceVerificationContent model:
data class VoiceVerificationContent(
var groupUId: String,
var groupName: String,
var displayCount: Int, // How many questions will be shown from the group
var contentType: String, // ConfirmedQuestion | ConfirmationText | UnconfirmedQuestion
var contentUId: String, // Unique ID for each question — used in SpeechToText
var contentText: String, // The question/text that will be shown to the user
var verifiedField: String?, // Field to be verified (only for ConfirmedQuestion)
var isRandom: Boolean, // Indicates whether the questions will be randomly ordered
var sortOrder: Int,
var expectedAnswers: List<ExpectedAnswer>
)
ExpectedAnswer model:
data class ExpectedAnswer(
var voiceVerificationContentUId: String,
var expectedAnswer: String,
var state: String,
var id: Int,
var uId: String,
var createDate: String,
var modifyDate: String,
var createUser: String?,
var modifyUser: String?
)
2. Sending Voice for Voice Verification¶
Used to process the user's voiced answer to each question with STT. It is called separately for each question:
EnQualifyUtility.getInstance().SpeechToText(
voice = "Base64AudioContent", // Base64 content of the audio recorded from the microphone
video = "Base64VideoContent", // Base64 content of the video recorded from the camera
contentUId = "contentUId" // VoiceVerificationContent.contentUId value
)
Callback:
override fun SpeechToText(text: String?) {
// text filled → STT successful, can proceed to the next question
// text empty → STT failed, error can be shown to the user
}
3. Voice Verification Approval Process¶
Called after the user answers and approves all questions for final verification:
Callback:
override fun ConversationalValidationApproved(validity: Boolean) {
// validity true → Verification successful, flow can be directed to the next step
// validity false → Verification failed, error can be shown to the user
}
Callback Reference¶
| Callback | Description |
|---|---|
tokenCreateCompleted(isNewCreatedToken: Boolean) | Triggered when a token is created |
tokenCreateFailed(errorMessage: String) | Token creation error |
settingGetFailed(errorMessage: String) | Triggered when settings cannot be obtained |
sessionAddFailed(errorMessage: String) | Session creation error |
sessionCloseCompleted(status: CallSessionTypeStatus) | Triggered when a session is closed |
sessionCloseFailed(errorMessage: String) | Session closing error |
integrationAddCompleted() | Integration data successfully added |
integrationAddFailed(errorMessage: String) | Integration data could not be added |
initializeFailed(failureCode: FailureCode, additionalMessage: String) | Initialization error |
baseModelCompleted() | Initialization completed, Utility functions are ready |
ConversationalValidationConfig(response: VoiceVerificationMobileListResponse?) | Triggered when question configuration is successfully obtained, all questions come through this callback |
ConversationalValidationConfigFailed() | Triggered when question configuration could not be obtained |
SpeechToText(text: String?) | Triggered when the STT process is completed for each question |
ConversationalValidationApproved(validity: Boolean) | The final verification result is returned through this callback |