### Initialize Amani SDK UI
Source: https://github.com/amani-ai-org/android.sdk.ui/blob/main/README.md
Initializes the Amani SDK UI with application context, server URL, SDK version, and shared secret. This must be called before any other SDK methods.
```kotlin
AmaniSDKUI.init(
applicationContext = this,
serverURL = TestCredentials.SERVER_URL,
amaniVersion = AmaniVersion.V2,
sharedSecret = null
)
```
--------------------------------
### Proceed to KYC Verification
Source: https://github.com/amani-ai-org/android.sdk.ui/blob/main/README.md
Initiates the KYC verification process by launching the Amani KYC activity. It requires the current activity, a result launcher, user identification details, authentication token, language, and optional location, birth date, expiry date, document number, email, phone number, and full name.
```kotlin
AmaniSDKUI.goToKycActivity(
activity = this, //Activity pointer
resultLauncher = resultLauncher, //Requires for listening the activity result, sample resultLauncher is below
idNumber = ID_CARD_NUMBER,
authToken = AUTH_TOKEN_FOR_SECURITY,
language = "tr",
geoLocation = true, //Giving permission to access SDK user's location data to process that data
birthDate = BIRTH_DATE, //YYMMDD format. (For Example: 20 May 1990 is 900520). If NFC not used not mandatory
expireDate = EXPIRE_DATE, //YYMMDD format. Expire date of SDK user's ID Card, If NFC not used not mandatory
documentNumber = DOCUMENT_NUMBER, // Document number of SDK user's ID Card, If NFC not used not mandatory
userEmail = "test@gmail.com", // Email of the SDK user, non mandatory field
userPhoneNumber = PHONE_NUMBER, //Phone number of the SDK user, non mandatory field,
userFullName = FULL_NAME //Full name of the SDK user, non mandatory field
)
```
--------------------------------
### Configure Repositories in Project Gradle
Source: https://github.com/amani-ai-org/android.sdk.ui/blob/main/README.md
Configures the project-level build.gradle file to include necessary repositories (Jitpack and Amani SDK's Artifactory) for dependency resolution.
```gradle
allprojects {
repositories {
maven {
url 'https://jitpack.io'
}
maven {
url = "https://jfrog.amani.ai/artifactory/amani-sdk"
}
}
}
```
--------------------------------
### Configure KYC Features
Source: https://github.com/amani-ai-org/android.sdk.ui/blob/main/README.md
Configures various KYC detection and recording features before initiating the KYC activity. These settings control hologram detection and video recording for ID capture and selfies.
```kotlin
//Enable/disable ID Card Hologram detection check for extra security
AmaniSDKUI.setHologramDetection(true)
//Enable/disable ID Card Scanning session video record
AmaniSDKUI.setIdCaptureVideoRecord(false)
//Enable/disable Selfie Capture session video record
AmaniSDKUI.setSelfieCaptureVideoRecord(false)
```
--------------------------------
### Gradle Properties Configuration
Source: https://github.com/amani-ai-org/android.sdk.ui/blob/main/README.md
Specifies the necessary Gradle properties for the Android project to ensure compatibility and proper functioning of the Amani SDK UI. This includes disabling R8 full mode, enabling AndroidX, and enabling Jetifier.
```properties
android.enableR8.fullMode=false
android.useAndroidX=true
android.enableJetifier=true
```
--------------------------------
### Android Manifest Permissions
Source: https://github.com/amani-ai-org/android.sdk.ui/blob/main/README.md
Lists the essential permissions required in the AndroidManifest.xml file for the Amani SDK UI to function correctly, including location, internet, camera, storage, network state, phone state, and NFC access.
```xml
```
--------------------------------
### Gradle Build Configurations for Assets
Source: https://github.com/amani-ai-org/android.sdk.ui/blob/main/README.md
Configures Gradle to prevent compression of '.tflite' model files and exclude a specific metadata file that might cause build conflicts.
```gradle
android {
aaptOptions {
noCompress "tflite"
}
packaging {
resources {
it.excludes += "META-INF/versions/9/OSGI-INF/MANIFEST.MF"
}
}
}
```
--------------------------------
### Register for KYC Result
Source: https://github.com/amani-ai-org/android.sdk.ui/blob/main/README.md
Registers an ActivityResultLauncher to handle the result of the KYC process. It checks if the result is OK and extracts KYC data from the returned Intent.
```kotlin
private val resultLauncher = this.registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
if (result.resultCode == Activity.RESULT_OK) {
// There are no request codes
val data: Intent? = result.data
data?.let {
//Result of the KYC process
val kycResult: KYCResult? = it.parcelable(AppConstant.KYC_RESULT)
}
}
}
```
--------------------------------
### Add Amani SDK UI Dependency
Source: https://github.com/amani-ai-org/android.sdk.ui/blob/main/README.md
This snippet shows how to add the Amani SDK UI package as a dependency in your Android module's build.gradle file. Replace 'Tag' with the latest release version.
```groovy
implementation 'com.github.AMANI-AI-ORG:Android.SDK.UI:Tag'
```
--------------------------------
### Enable DataBinding in Gradle
Source: https://github.com/amani-ai-org/android.sdk.ui/blob/main/README.md
Enables the DataBinding feature in your Android module by adding the specified line within the 'android' block of your build.gradle file.
```gradle
android {
dataBinding {
enabled true
}
}
```
--------------------------------
### ProGuard Rules for Android SDK UI
Source: https://github.com/amani-ai-org/android.sdk.ui/blob/main/README.md
These ProGuard rules are necessary when using ProGuard or R8 for code shrinking and obfuscation. They ensure that essential classes from the SDK, including AI, data management, network management, JNI library, and third-party libraries like TensorFlow Lite, Bouncy Castle, and jmrtd, are not removed or obfuscated in a way that breaks functionality. The `-dontwarn` directives are used to suppress warnings for classes that might not be present or are handled by other means.
```java
-keep class ai.** {*;}
-dontwarn ai.**
-keep class datamanager.** {*;}
-dontwarn datamanager.**
-keep class networkmanager.** {*;}
-dontwarn networkmanager.**
-keep class ai.amani.jniLibrary.CroppedResult.**{*;}
-keep class org.jmrtd.** {*;}
-keep class net.sf.scuba.** {*;}
-keep class org.bouncycastle.** {*;}
-keep class org.spongycastle.** {*;}
-keep class org.ejbca.** {*;}
-dontwarn org.ejbca.**
-dontwarn org.bouncycastle.**
-dontwarn org.spongycastle.**
-dontwarn org.jmrtd.**
-dontwarn net.sf.scuba.**
-keep class org.tensorflow.lite**{ *; }
-dontwarn org.tensorflow.lite.**
-keep class org.tensorflow.lite.support**{ *; }
-dontwarn org.tensorflow.lite.support**
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.