Skip to content

Android - Core Module

The Core Module is the module that provides the basic structure and functionality for the use of all other modules. It hosts reusable components and infrastructure throughout the project. The Core Module must be added to the project before using any other modules.


Adding to the Project

After ensuring that the Maven access is provided, follow the steps below. (See Getting Started)

1. Add to the libs.versions.toml file:

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

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

2. Add the dependency to the build.gradle.kts file:

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

3. Gradle Sync

Synchronize the Gradle files by clicking "Sync Now".

ℹ️ The version number to be used will be communicated to you specifically. All modules must use the same version.


Permissions

To obtain detailed information regarding the network connection type (2G/3G/4.5G), the following permission must be manually obtained by the application:

Text Only
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

⚠️ This permission is not requested automatically by the SDK. If permission is not granted, the mobile data type will only be displayed as "Mobile".


Data Models

BaseModel

This data model contains the server (backoffice) connection address and SSL certificate information used in validation processes.

Signalling (Video Call) and MAPI certificates can be provided in both file and Base64 formats; it is unnecessary to provide both formats together. Certificate files should be added to the res/raw folder within the Android project, and the same filename must be given as a parameter in this model. If no certificate is provided, the SDK will operate without the SSL Pinning feature.

Text Only
data class BaseModel(
    var baseURL: String,                                    // Required field
    var signallingCertificateList: List<String>? = null,
    var mapiCertificateList: List<String>? = null,
    var signallingCertificateBase64List: List<String>? = null,
    var mapiCertificateBase64List: List<String>? = null,
    var mobileUser: String,                                 // Required field
    var countryCode: String? = null,                        // Default: "TUR"
    var locale: String = "TR",
    var useEmbeddedLocalSound: Boolean = false
)

Features

Feature Type Required Description
baseURL String The basic server address used for API validation processes
mobileUser String Special keyword used during token processing
signallingCertificateList List<String?>? Array of signalling (GG) certificates in text format
mapiCertificateList List<String?>? Array of MAPI certificates in text format
signallingCertificateBase64List List<String?>? Array of signalling certificates in Base64 format
mapiCertificateBase64List List<String?>? Array of MAPI certificates in Base64 format
countryCode String The country code of the identity to be read
locale String The language of voice prompts and texts (default: "TR")
useEmbeddedLocalSound Boolean Determines whether sounds will be sourced locally or from the service (default: false)

Usage Example

Text Only
val baseModel = BaseModel(
    signallingCertificateList = listOf("AI_CERT_1", "AI_CERT_2"),
    mapiCertificateList = listOf("MAPI_CERT_1", "MAPI_CERT_2"),
    signallingCertificateBase64List = listOf("QUlDRVJU...", "Q0VSVF8y..."),
    mapiCertificateBase64List = listOf("TU9SRSB...", "Q0VSVF8z..."),
    baseURL = "API_SERVER_URL",
    mobileUser = "mobile",
    countryCode = "TUR",
    locale = "TR",
    useEmbeddedLocalSound = false
)

SessionModel

This data model contains user and identity information during a call session. It includes call type, user details, credentials, and additional parameters related to the session.

Text Only
data class SessionModel(
    var callType: String,                       // Required field
    var reference: String,                      // Required field
    var userName: String? = null,
    var surname: String? = null,
    var phone: String? = null,
    var email: String? = null,
    var identityType: String? = null,
    var identityNo: String? = null,
    var canAutoClose: Boolean = false,
    var isContinue: Boolean = false,            // 'continue' is reserved in Kotlin, thus isContinue
    var category: String? = null,
    var taxNumber: String? = null,
    var businessReference: String? = null,
    var handicapped: Boolean? = false
)

Features

Feature Type Required Description
callType String Parameter indicating the type of call (e.g., "NewCustomer")
reference String Reference ID for the session
userName String? User's name
surname String? User's surname
phone String? User's phone number
email String? User's email address
identityType String? Type of identity (e.g., "I", "P")
identityNo String? User's identity number
canAutoClose Boolean Determines whether the session can close automatically (default: false)
isContinue Boolean Indicates whether the session is an ongoing process (default: false)
category String? Category to which the session belongs
taxNumber String? Tax number belonging to the user
businessReference String? Reference information related to the business
handicapped Boolean? Flag indicating whether the user is disabled (default: false)

Usage Example

Text Only
val session = SessionModel(
    callType = "NewCustomer",
    reference = UUID.randomUUID().toString(),
    userName = "Enqura",
    surname = "Information",
    phone = "+905551234567",
    email = "enqualifyplus@enqura.com",
    identityType = "TC. Identity Card",
    identityNo = "12345678901",
    canAutoClose = true,
    isContinue = false,
    category = "category",
    taxNumber = "9876543210",
    businessReference = "COMPANY",
    handicapped = false
)

CustomerIDDoc

This data model stores the data read from the identity document as a result of OCR processing. It operates in a singleton structure; the data is accessed via CustomerIDDoc.getInstance().

For detailed information, refer to the OCR Module page.

Text Only
class CustomerIDDoc {
    var identityType: String = ""
    var name: String = ""
    var surname: String = ""
    var identityNumber: String = ""
    var issuingState: String = ""
    var documentNumber: String = ""
    var dateOfBirthDay: String = ""
    var expiryDate: String = ""
    var nationality: String = ""
    var gender: String = ""
    var frontImage: Bitmap? = null
    var mrzImage: Bitmap? = null
    var holoImage: Bitmap? = null
    var face: Bitmap? = null
    var frontIdentityNumber: String? = null
    var frontExpiryDate: String? = null
    var frontBirthDate: String? = null
    var frontGender: String? = null
    var frontDocumentNumber: String? = null
    var optionalData1: String? = null
    var optionalData2: String? = null
    var mrzText: String? = null
    val visualItems: MutableMap<String, VisualItem> = mutableMapOf()
    var digitDocumentNumber: Char? = null
    var digitDateOfBirth: Char? = null
    var digitExpiryDate: Char? = null
    var sumDigit: Char? = null
}

Features

Feature Type Description
identityType String Identity type ("I" or "P")
name String Name of the identity holder
surname String Surname of the identity holder
identityNumber String Identity number
issuingState String Country/region code where the identity was issued
documentNumber String Document number of the identity
dateOfBirthDay String Date of birth of the identity holder
expiryDate String Expiry date of the identity
nationality String Country code of the identity holder's nationality
gender String Gender (M/F, K/F, etc.)
frontImage Bitmap? Image of the front of the identity (comes blank for identities with MRZ at the front)
mrzImage Bitmap? Image of the MRZ field
holoImage Bitmap? Image of the hologram field
face Bitmap? Photo on the identity (may be blank for identities under 18 years)
frontIdentityNumber String? Identity number obtained from the front side
frontExpiryDate String? Expiry date obtained from the front side
frontBirthDate String? Date of birth obtained from the front side
frontGender String? Gender information obtained from the front side
frontDocumentNumber String? Document number obtained from the front side
optionalData1 String? Optional data 1 from the MRZ field
optionalData2 String? Optional data 2 from the MRZ field
mrzText String? Full text from the MRZ field
visualItems MutableMap<String, VisualItem> Images of objects detected after visual analysis
digitDocumentNumber Char? Verification digit of the document number from the MRZ
digitDateOfBirth Char? Verification digit of the date of birth from the MRZ
digitExpiryDate Char? Verification digit of the expiry date from the MRZ
sumDigit Char? General verification digit of the MRZ field

Usage Example

Text Only
private lateinit var customerIdDoc: CustomerIDDoc

override fun init() {
    customerIdDoc = CustomerIDDoc.getInstance()
    initPage()
}

CustomerChip

This data model stores the data read from the identity chip as a result of the NFC reading process. It also contains results of NFC security protocols such as BAC, CA, HT, AA, and CS. It operates in a singleton structure; the data is accessed via CustomerChip.getInstance().

For detailed information, refer to the NFC Module page.

Text Only
class CustomerChip {
    var documentCode: DocumentCode = DocumentCode.I
    var identityType: String? = null
    var identityNo: String? = null
    var documentNo: String? = null
    var firstName: String? = null
    var lastName: String? = null
    var gender: String? = null
    var birthDate: String? = null
    var nationality: String? = null
    var expiryDate: String? = null
    var faceImage: Bitmap? = null
    var nameOfHolder: String? = null
    var surnameOfHolder: String? = null
    var placeOfBirth: String? = null
    var fullDateOfBirth: String? = null
    var BAC: NFCFeatureWithResult<Boolean> = NFCFeatureWithResult()
    var CA: NFCFeatureWithResult<EACCAResult> = NFCFeatureWithResult()
    var HT: NFCFeatureWithResult<MutableMap<Int, HashMatchResult>?> = NFCFeatureWithResult()
    var AA: NFCFeatureWithResult<AAResult> = NFCFeatureWithResult()
    var CS: NFCFeatureWithResult<Boolean> = NFCFeatureWithResult()
}

Basic Features

Feature Type Description
documentCode DocumentCode Enum value indicating the type of document
identityType String? Type of the identity document
identityNo String? Identity document number
documentNo String? Official document number
firstName String? Name of the document holder
lastName String? Surname of the document holder
gender String? Gender information
birthDate String? Date of birth
nationality String? Country of nationality
expiryDate String? Expiry date of the document
faceImage Bitmap? Biometric photo obtained from the chip (used in comparison with the Face module)
nameOfHolder String? Local name of the document holder
surnameOfHolder String? Local surname of the document holder
placeOfBirth String? Place of birth
fullDateOfBirth String? Full date of birth (day, month, year)

NFC Security Protocol Results

Feature Type Description
BAC NFCFeatureWithResult<Boolean> Basic Access Control — result of the security protocol for document reading (true: successful)
CA NFCFeatureWithResult<EACCAResult> Chip Authentication — result of chip identity authentication
HT NFCFeatureWithResult<MutableMap<Int, HashMatchResult>?> Hash Table — results of hash value verification
AA NFCFeatureWithResult<AAResult> Active Authentication — result of identity authentication with asymmetric encryption
CS NFCFeatureWithResult<Boolean> Chip Signature — result of chip signature validity (true: valid)

Usage Example

Text Only
private lateinit var customerChip: CustomerChip

override fun init() {
    customerChip = CustomerChip.getInstance()
    initPage()
}

CustomerFace

This data model stores the data obtained as a result of face recognition and liveliness check processes. It operates in a singleton structure; the data is accessed via CustomerFace.getInstance().

For detailed information, refer to the Face Module page.

Basic Features

Feature Type Description
faceDetectedImage Bitmap? Image of the face detected by the camera
smilingDetectedImage Bitmap? Image obtained when a smile is detected
possibilityOfSmiling Float? Probability of smiling (between 0–1)
faceLeftDetectedImage Bitmap? Image obtained when the head is turned to the left
faceRightDetectedImage Bitmap? Image obtained when the head is turned to the right
faceUpDetectedImage Bitmap? Image obtained when the head is lifted up
eyeCloseDetectedImage Bitmap? Image obtained when the eyes are closed
antiSpoofing Double? Fraud detection score
antiSpoofingValidityLevel Int? Anti-spoofing validity level
idDocConfidence Int? Confidence level of comparison between the identity photo and the face
idDocDistance Double? Distance between the identity document and the face
chipConfidence Int? Confidence level of comparison between the NFC chip biometrics and the face
chipDistance Double? Distance between the NFC chip and the face

IntegrationModel

This data model is used to send data via the SDK during the integration phase through the addIntegration function.

Text Only
data class IntegrationModel(
    val phone: String? = null,
    val email: String? = null,
    val formUrl: String? = null,
    val idRegistration: IDRegistration? = null,
    val addressRegistration: AddressRegistration? = null,
    val data: String
)

Proguard Rules

To ensure the correct functioning of the Core SDK in release packages (minifyEnabled = true, debuggable = false), add the following rules to the proguard-rules.pro file:

Text Only
-keep interface com.enqualify.plus.core.CoreCallbacks { *; }
-keep public class com.enqualify.plus.core.** { *; }
-keepclassmembers class * { public static <methods>; }
-keep interface com.enqualify.plus.core.** { *; }
-keep class com.enqualify.plus.core.** { abstract *; }
-keep @androidx.annotation.Keep class * { *; }
-keepclassmembers,allowobfuscation class * { @androidx.annotation.Keep *; }

Next Steps

After completing the installation of the Core Module, you may proceed to the following modules as needed:

  • OCR Module — Optical character recognition from identity documents
  • NFC Module — NFC reading from identity chips
  • Face Module — Face recognition and liveliness check
  • VideoCall Module — Video call integration