Commit 0a48da81 authored by Javokhir's avatar Javokhir
Browse files

2.1.1

parent a389a698
# Built application files
*.apk
#*.aar
*.ap_
*.aab
*.DS_Store
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
release/
# Gradle files
.gradle
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Log/OS Files
*.log
# Proguard folder generated by Eclipse
proguard/
# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
output.json
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# IntelliJ
*.iml
.idea
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/
# Google Services (e.g. APIs or Firebase)
#google-services.json
# Android Profiling
*.hprof
# Freeline
freeline.py
freeline/
freeline_project_description.json
# Generated files
bin/
gen/
out/
release/
# Proguard folder generated by Eclipse
proguard/
# MacOS
.DS_Store
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
# Version control
vcs.xml
# Lint
# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
lint/reports/
# App Specific cases
app/release/output.json
.idea/codeStyles/
\ No newline at end of file
......@@ -11,6 +11,7 @@
- [Handling callbacks](#12-handling-callbacks)
- [SDK error codes](#sdk-error-codes)
- [Localization](#localization)
- [Custom Organization Details](#custom-organization-details)
## Getting started
......@@ -23,10 +24,8 @@ The SDK supports API level 21 and above
Make sure that your app meets the following requirements:
- `minSdkVersion = 21`
- `targetSdkVersion = 31`
- `targetSdkVersion = 33`
- `android.useAndroidX = true`
- `Kotlin = 1.5+`
- `Gradle = 4.1.2+`
```
compileOptions {
......@@ -46,34 +45,36 @@ libraries (For example libs) and copy MyId SDK provided libraries.
Add reference to library to module **_build.gradle_**:
``` gradle
implementation(files("libs/myid-sdk-2.1.0-release.aar"))
implementation(files("libs/myid-sdk-2.1.1-release.aar"))
```
**Note:** You can get `myid-sdk-2.1.0-release.aar` file from [here](app/libs/myid-sdk-2.1.0-release.aar)
**Note:** You can get `myid-sdk-2.1.1-release.aar` file from [here](app/libs/myid-sdk-2.1.1-release.aar)
After synchronization, You should be able to access to SDK classes from your source code.
MyId Android SDK also requires following libraries to be added:
``` gradle
implementation(files("libs/myid-sdk-2.1.1-release.aar"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")
implementation("androidx.core:core-ktx:1.8.0")
implementation("androidx.appcompat:appcompat:1.4.2")
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.5.1")
def cameraVersion = "1.2.0-alpha01"
def cameraVersion = "1.2.0-rc01"
implementation("androidx.camera:camera-camera2:$cameraVersion")
implementation("androidx.camera:camera-lifecycle:$cameraVersion")
implementation("androidx.camera:camera-view:$cameraVersion")
implementation("com.google.android.gms:play-services-mlkit-face-detection:17.0.1")
implementation("com.google.android.gms:play-services-mlkit-text-recognition:18.0.0")
implementation("com.google.android.gms:play-services-mlkit-barcode-scanning:18.0.0")
implementation("com.google.android.gms:play-services-mlkit-face-detection:17.1.0")
implementation("com.google.android.gms:play-services-mlkit-text-recognition:18.0.2")
implementation("com.google.android.gms:play-services-mlkit-barcode-scanning:18.1.0")
implementation("io.ktor:ktor-client-android:2.0.1")
implementation("io.sentry:sentry-android:5.7.4")
implementation("io.sentry:sentry-android:6.7.0-alpha.1")
```
### 1.3 Permissions
......@@ -111,6 +112,7 @@ class YourActivity : AppCompatActivity(), MyIdResultListener {
.withEntryType(MyIdEntryType.AUTH)
.withOrganizationDetails(organizationDetails)
.withBuildMode(MyIdBuildMode.PRODUCTION)
.withLocale(MyIdLocale.UZ)
.withPhoto(false)
.build()
......@@ -133,6 +135,7 @@ Method | Notes | Default
`withEntryType(value: MyIdEntryType)` | Customizing the SDK. Entry types: AUTH, FACE | MyIdEntryType.AUTH
`withOrganizationDetails(value: OrganizationDetails)` | Custom Organization Details | Optional
`withBuildMode(value: MyIdBuildMode)` | Build mode: DEBUG, PRODUCTION | MyIdBuildMode.PRODUCTION
`withLocale(value: MyIdLocale)` | To set a specific language | MyIdLocale.UZ
`withPhoto(value: Boolean)` | Return SDK face bitmap | false
**Note 1.1.** `MyIdEntryType` contains **AUTH** and **FACE** types.
......@@ -155,24 +158,24 @@ the SDK requires the input of passport data and date of birth for user identific
```kotlin
val resultListener: MyIdResultListener = object : MyIdResultListener {
override fun onSuccess(result: MyIdResult) {
// Get face bitmap and result code
override fun onSuccess(result: MyIdResult) {
// Get face bitmap and result code
val bitmap = result.bitmap
val code = result.code
val comparison = result.comparison
}
val bitmap = result.bitmap
val code = result.code
val comparison = result.comparison
}
override fun onUserExited() {
// User left the SDK
}
override fun onUserExited() {
// User left the SDK
}
override fun onError(e: MyIdException) {
// Get error message and code:
override fun onError(e: MyIdException) {
// Get error message and code:
val message = e.message
val code = e.code
}
val message = e.message
val code = e.code
}
}
```
......@@ -227,9 +230,8 @@ The MyId Android SDK supports translations for the following languages:
- English (en) 🇬🇧
- Russian (ru) 🇷🇺
By default, we infer the language to use from the parent app settings.
The MyId Android SDK also allows for the selection of a specific custom language for locales that MyId does not currently support. You can have an additional XML strings file inside your resources folder for the desired locale (for example, `res/values-kk/myid_strings.xml` for 🇰🇿 translation), with the content of our [strings.xml](myid_strings.xml) file, translated for that locale.
By default, the Uzbek language is used. However, you can also call the `withLocale(MyIdLocale)`
method of the `MyIdConfig.Builder` configuration to set the language.
## Custom Organization Details
......
No preview for this file type
......@@ -11,7 +11,7 @@ android {
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
versionName "1.0.0"
}
buildTypes {
......@@ -37,27 +37,26 @@ android {
}
dependencies {
implementation(files("libs/myid-sdk-2.1.0-release.aar"))
implementation(files("libs/myid-sdk-2.1.1-release.aar"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")
implementation("androidx.core:core-ktx:1.8.0")
implementation("androidx.appcompat:appcompat:1.4.2")
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.5.1")
implementation("com.google.android.material:material:1.6.1")
def cameraVersion = "1.2.0-alpha01"
def cameraVersion = "1.2.0-rc01"
implementation("androidx.camera:camera-camera2:$cameraVersion")
implementation("androidx.camera:camera-lifecycle:$cameraVersion")
implementation("androidx.camera:camera-view:$cameraVersion")
implementation("com.google.android.gms:play-services-mlkit-face-detection:17.0.1")
implementation("com.google.android.gms:play-services-mlkit-text-recognition:18.0.0")
implementation("com.google.android.gms:play-services-mlkit-barcode-scanning:18.0.0")
implementation("com.google.android.gms:play-services-mlkit-face-detection:17.1.0")
implementation("com.google.android.gms:play-services-mlkit-text-recognition:18.0.2")
implementation("com.google.android.gms:play-services-mlkit-barcode-scanning:18.1.0")
implementation("com.google.android.material:material:1.7.0")
implementation("io.ktor:ktor-client-android:2.0.1")
implementation("io.sentry:sentry-android:5.7.4")
implementation("io.sentry:sentry-android:6.7.0-alpha.1")
}
\ No newline at end of file
No preview for this file type
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/purple_500" android:state_focused="true" />
<item android:color="@color/purple_500" android:state_hovered="true" />
<item android:color="@color/color_gray_500" android:state_enabled="false" />
<item android:color="@color/color_gray_500" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
tools:context=".FaceActivity">
<androidx.camera.view.PreviewView
android:id="@+id/previewView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:scaleType="fitCenter" />
</FrameLayout>
......@@ -13,20 +13,26 @@
android:padding="20dp">
<com.google.android.material.textfield.TextInputLayout
style="@style/TextInputOutlined"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/client_id"
app:helperText="* Required"
app:helperTextEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/inputClientId"
style="@style/TextInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:importantForAutofill="no"
android:inputType="textMultiLine" />
android:inputType="textMultiLine"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/TextInputOutlined"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:hint="@string/passport"
app:helperText="* Optional"
......@@ -34,12 +40,16 @@
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/inputPassportData"
style="@style/TextInput"
android:importantForAutofill="no" />
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:importantForAutofill="no"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/TextInputOutlined"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:hint="@string/birth_date"
app:helperText="* Optional"
......@@ -48,12 +58,16 @@
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/inputDate"
style="@style/TextInput"
android:importantForAutofill="no" />
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:importantForAutofill="no"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/TextInputOutlined"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:hint="@string/external_id"
app:helperText="* Optional"
......@@ -61,13 +75,17 @@
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/inputExternalId"
style="@style/TextInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:importantForAutofill="no"
android:inputType="textMultiLine" />
android:inputType="textMultiLine"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/TextInputOutlined"
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:hint="@string/organization_phone_number"
app:helperText="* Optional"
......@@ -75,9 +93,11 @@
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/inputPhoneNumber"
style="@style/TextInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:importantForAutofill="no"
android:inputType="phone" />
android:inputType="phone"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
......@@ -179,12 +199,13 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/buttonStart"
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
style="@style/Widget.Material3.Button.UnelevatedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:text="@string/scan_face_data" />
android:text="@string/scan_face_data"
android:textAppearance="@style/TextAppearance.Material3.BodyLarge" />
<TextView
android:id="@+id/textResult"
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="color_gray_500">#9E9E9E</color>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Text16sp" parent="MyIdTextBaseStyle">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:includeFontPadding">false</item>
<item name="android:textAllCaps">false</item>
<item name="android:textColor">@color/black</item>
<item name="android:textSize">16sp</item>
</style>
<style name="TextInput" parent="Text16sp">
<item name="android:layout_width">match_parent</item>
<item name="android:inputType">text</item>
<item name="android:saveEnabled">false</item>
<item name="android:scrollHorizontally">true</item>
<item name="android:singleLine">true</item>
<item name="android:textColorHint">@color/color_gray_500</item>
</style>
<style name="TextInputOutlined" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColorHint">@color/color_input</item>
<item name="boxCornerRadiusBottomEnd">8dp</item>
<item name="boxCornerRadiusBottomStart">8dp</item>
<item name="boxCornerRadiusTopEnd">8dp</item>
<item name="boxCornerRadiusTopStart">8dp</item>
<item name="boxStrokeColor">@color/color_input</item>
<item name="boxStrokeWidth">1dp</item>
<item name="boxStrokeWidthFocused">1dp</item>
<item name="hintTextAppearance">@style/Text16sp</item>
<item name="hintTextColor">@color/color_input</item>
<item name="placeholderTextAppearance">@style/Text16sp</item>
<item name="placeholderTextColor">@color/color_gray_500</item>
</style>
</resources>
\ No newline at end of file
<resources>
<style name="Theme.MyIdSample" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
</style>
<style name="Theme.MyIdSample" parent="Theme.Material3.Light.NoActionBar" />
</resources>
\ No newline at end of file
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
plugins {
id "com.android.application" version "7.3.0" apply false
id "com.android.library" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}
\ No newline at end of file
#Mon May 16 21:32:32 UZT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
......@@ -17,7 +17,7 @@
<string name="myid_exit">Выйти</string>
<string name="myid_hour">час</string>
<string name="myid_hours">час</string>
<string name="myid_id_card">ID Карта</string>
<string name="myid_id_card">ID Card</string>
<string name="myid_internal_error">Непредвиденная ошибка</string>
<string name="myid_liveness_fail">Не удалось подтвердить жизненность</string>
<string name="myid_loading">Проводится идентификация</string>
......
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "myid-sample"
include ":app"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment