Skip to content

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:

  • Listing Call Types
  • Appointment System (Query / Create / Cancel)
  • Document Addition
  • Document Signing
  • Barcode Reading
  • Address Verification
  • Corporate Customer Acquisition (KYB)
  • Voice Verification

⚠️ Prerequisite: Access to Maven must be provided and the Core Module must be added to the project.


Adding to Project

1. Add to libs.versions.toml:

Text Only
[versions]
...
enqualify-plus = "x.x.x.x"

[libraries]
...
enqualify-plus-utility = {
    group = "com.enqualify.plus",
    name = "utility",
    version.ref = "enqualify-plus"
}

2. Add Dependency in build.gradle.kts:

Text Only
implementation(libs.enqualify.plus.utility)

3. Gradle Sync

Sync the Gradle files by clicking on the "Sync Now" option.


Implementation

1. Activity Layout — FrameLayout

Text Only
<FrameLayout
    android:id="@+id/fragmentContainer"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

2. Adding UtilityCallbacks Interface

Adding to the class:

Text Only
class EnQualifyPlusActivity : AppCompatActivity(), UtilityCallbacks

Overriding Callbacks:

Text Only
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 are available
    }
}

3. Initializing EnQualifyUtility

Unlike other modules, the utility module does not take SessionModel and does not use settings. It is initialized only with BaseModel:

Text Only
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
)

Initialize Parameters

Parameter Type Description
context Context Runtime context of the application
baseModel BaseModel Model containing server connection and certificate information
fragmentManager FragmentManager Manages fragments
containerId Int ID of the container where the fragment will be added

When 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>:

Text Only
data class DataModel<T>(
    val isSuccess: Boolean,
    val data: T? = null,
    val errorMessage: String? = null
)

The data field can be of type String, Boolean, or a custom class depending on the function.


Listing Call Types

Lists the active call types in the current environment. The returned code value can be set to the SessionModel.callType field.

Text Only
EnQualifyUtility.getInstance().CallTypeGet(
    handler = "", // Can be left blank 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:

Text Only
data class CallType(
    var code: String? = null,   // Corresponds to SessionModel.callType value
    var name: String? = null    // Visible name that can be presented to the end user
)

Appointment System

Used in the partial application (scheduled video call) flow. If a partial application is to be made, SessionModel.isContinue must be set to true.

Querying Available Appointment Slots

Text Only
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:

Text Only
data class AppointmentAvailableListResponseData(
    var date: String? = null,
    var startTime: String? = null,
    var endTime: String? = null,
    var count: Int? = null
)

Creating an Appointment

Text Only
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> ->
        // Result of appointment creation can be used here
    }
)

AppointmentSaveData model:

Text Only
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
)

Cancelling an Appointment

Text Only
EnQualifyUtility.getInstance().AppointmentCancel(
    callType = "NewCustomer",
    identityType = "ID Card",
    identityNo = "12345678910",
    appointmentCancelListener = { dataModel: DataModel<Boolean> ->
        // Result of appointment cancellation can be used here
    }
)

Querying Current Appointments

Text Only
EnQualifyUtility.getInstance().AppointmentGet(
    identityType = "ID Card",
    identityNo = "12345678910",
    appointmentListListener = { dataModel: DataModel<ArrayList<AppointmentListResponseData>> ->
        // Current appointments can be used here
    }
)

AppointmentListResponseData model:

Text Only
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 categories that can be uploaded before document upload:

Text Only
EnQualifyUtility.getInstance().DocumentCategoryGetV2(
    subjectType = "Mobile",     // Individual: "Mobile" | Corporate: "KYB"
    callType = "NewCustomer",
    documentCategoryGetV2Listener = { dataModel: DataModel<DocumentCategoryGetV2ResponseData> ->
        // Document categories can be used here
    }
)

DocumentCategoryGetV2ResponseData model:

Text Only
data class DocumentCategoryGetV2ResponseData(
    var category: String? = null,
    var name: String? = null,
    var nameEn: String? = null,
    var sequence: Int? = null
)

2. Document Uploading

Used to upload documents after category information is obtained. 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
Text Only
val document = DocumentAddDocument(
    extension = ".pdf",
    content = "FileBase64Content",
    contentHash = "FileBase64ContentHash"
)

EnQualifyUtility.getInstance().DocumentAdd(
    category = "DriverLicense",   // 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

Text Only
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

Text Only
EnQualifyUtility.getInstance().SigningFinish(
    reference = "123456789",    // Must be the same as the reference used in SigningSet
    signingFinishListener = { dataModel: DataModel<Boolean> ->
        // Signature finish result can be used here
    }
)

Barcode Reading

Used to read the barcode of a document obtained through E-Government:

Text Only
EnQualifyUtility.getInstance().BarcodeRead(
    content = "Content",        // Base64 content of the document to be scanned
    identityNo = "123456789",   // TC Identity Number of the user performing the transaction
    isWithAddress = true,       // Whether to perform address verification with the document
    barcodeReadListener = { dataModel: DataModel<VerifyBarcodeReadResponseData> ->
        // Barcode reading result can be used here
    }
)

VerifyBarcodeReadResponseData model:

Text Only
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 a residence document through E-Government:

Text Only
EnQualifyUtility.getInstance().AddressVerify(
    identityNo = "123456789",   // TC Identity Number of the user performing the transaction
    barcode = "Barcode",        // Resulting barcode obtained from the BarcodeRead step
    addressVerifyListener = { dataModel: DataModel<Boolean> ->
        // Address verification result can be used here
    }
)

Corporate Customer Acquisition (KYB)

1. Adding a Customer

Text Only
EnQualifyUtility.getInstance().CallBusinessAddV2(
    taxNumber = "123456",
    name = "FullCompanyName",
    shortName = "CompanyShortName",
    data = "ExtraData",
    type = "CompanyType",
    reference = "123456789",
    callBusinessAddV2Listener = { dataModel: DataModel<CallBusinessAddV2ResponseData> ->
        // callBusinessUId should be obtained here — used in all subsequent KYB operations
    }
)

ℹ️ The callBusinessUId returning from callBusinessAddV2Listener is used as a mandatory parameter in all subsequent KYB services.

2. Checking a Customer

Text Only
EnQualifyUtility.getInstance().CallBusinessCheckV2(
    taxNumber = "123456",
    callBusinessCheckV2Listener = { dataModel: DataModel<CallBusinessCheckV2ResponseData> ->
        // Customer registration status can be used here
    }
)

CallBusinessCheckV2ResponseData model:

Text Only
data class CallBusinessCheckV2ResponseData(
    var checkRecord: Boolean? = null,
    var callBusinessUId: String? = null,
    var type: String? = null
)

3. Updating a Customer

Text Only
EnQualifyUtility.getInstance().CallBusinessUpdate(
    callBusinessUId = "123456",     // ID obtained from the Add Customer step
    type = "CompanyType",
    reference = "123456789",
    isInProgress = true,            // Indicates whether other KYB steps have been started
    callBusinessUpdateListener = { dataModel: DataModel<Boolean> -> }
)

4. Adding an Authorized Person

Text Only
EnQualifyUtility.getInstance().CallBusinessStaffAdd(
    callBusinessUId = "123456",
    name = "StaffName",
    surname = "StaffSurname",
    identityNo = "123456",
    birthDate = "01/01/1990",
    phone = "905055055050",
    callBusinessStaffAddListener = { dataModel: DataModel<Boolean> -> }
)

5. Removing an Authorized Person

Text Only
EnQualifyUtility.getInstance().CallBusinessStaffRemove(
    callBusinessUId = "123456",
    identityNo = "123456",
    callBusinessStaffRemoveListener = { dataModel: DataModel<Boolean> -> }
)

6. Checking an Authorized Person

Text Only
EnQualifyUtility.getInstance().CallBusinessStaffCheckV2(
    identityNo = "123456",
    callBusinessUId = "123456",
    callBusinessStaffCheckV2Listener = { dataModel: DataModel<CallBusinessStaffCheckV2ResponseData> -> }
)

7. Listing Corporate Document Categories

Text Only
EnQualifyUtility.getInstance().DocumentKYBCategoryListV2(
    documentKYBCategoryListV2Listener = { dataModel: DataModel<ArrayList<DocumentKYBCategoryListV2ResponseData>> ->
        // Corporate document categories can be used here
    }
)

DocumentKYBCategoryListV2ResponseData model:

Text Only
data class DocumentKYBCategoryListV2ResponseData(
    var category: String? = null,
    var name: String? = null,
    var nameEn: String? = null,
    var sequence: Int? = null
)

8. Adding a Corporate Document

Text Only
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

This module pulls the configured question groups defined in the back office and gets voice responses from the user, validating these responses with STT (Speech-to-Text).

1. Pulling All Questions

Used to initiate the voice verification flow and obtain question configurations defined in the back office:

Text Only
EnQualifyUtility.getInstance().ConversationalValidation(
    sessionModel = sessionModel
)

Upon success, the ConversationalValidationConfig callback is triggered, and the entire question list is obtained from response:

Text Only
override fun ConversationalValidationConfig(response: VoiceVerificationMobileListResponse?) {
    // All question list comes here, the flow is managed through these responses
}

override fun ConversationalValidationConfigFailed() {
    // Question configuration could not be obtained
}

Note

The question list comes in the format of the following models.

VoiceVerificationMobileListResponse model:

Text Only
data class VoiceVerificationMobileListResponse(
    var isSuccessful: Boolean,
    var referenceId: String,
    var data: List<VoiceVerificationContent>
)

VoiceVerificationContent model:

Text Only
data class VoiceVerificationContent(
    var groupUId: String,
    var groupName: String,
    var displayCount: Int,       // How many questions to be displayed from the group
    var contentType: String,     // ConfirmedQuestion | ConfirmationText | UnconfirmedQuestion
    var contentUId: String,      // Unique ID for each question — used in SpeechToText
    var contentText: String,     // Question/text to be displayed to the user
    var verifiedField: String?,  // Identity field to be verified (only for ConfirmedQuestion)
    var isRandom: Boolean,       // Whether questions are to be in random order
    var sortOrder: Int,
    var expectedAnswers: List<ExpectedAnswer>
)

ExpectedAnswer model:

Text Only
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 voice response to each question with STT. Called separately for each question:

Text Only
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:

Text Only
override fun SpeechToText(text: String?) {
    // text filled   → STT successful, can proceed to the next question
    // text empty    → STT failed, an error can be shown to the user
}

3. Voice Verification Approval Process

Called for final verification after the user has answered and approved all questions:

Text Only
EnQualifyUtility.getInstance().ConversationalValidationApprove()

Callback:

Text Only
override fun ConversationalValidationApproved(validity: Boolean) {
    // validity true  → Verification successful, flow can be directed to the next step
    // validity false → Verification failed, an error can be shown to the user
}

Callback Reference

Callback Description
tokenCreateCompleted(isNewCreatedToken: Boolean) Triggered when the token is created
tokenCreateFailed(errorMessage: String) Token creation error
settingGetFailed(errorMessage: String) Triggered when settings cannot be retrieved
sessionAddFailed(errorMessage: String) Session creation error
sessionCloseCompleted(status: CallSessionTypeStatus) Triggered when the session is closed
sessionCloseFailed(errorMessage: String) Session closing error
integrationAddCompleted() Integration data added successfully
integrationAddFailed(errorMessage: String) Integration data could not be added
initializeFailed(failureCode: FailureCode, additionalMessage: String) Initialize error
baseModelCompleted() Initialization completed, Utility functions are ready
ConversationalValidationConfig(response: VoiceVerificationMobileListResponse?) Triggered when question configuration is successfully received, all questions come through this callback
ConversationalValidationConfigFailed() Triggered when question configuration cannot be retrieved
SpeechToText(text: String?) Triggered when the STT process is completed for each question
ConversationalValidationApproved(validity: Boolean) The final verification result is returned via this callback