Due to the advanced validation support (in C++ code), we recommend that the integrator app performs [multi-APK split](#multi-apk-split) to optimize the app size for individual architectures.
Average size (with Proguard enabled):
| ABI | Size |
|-------------|:--------:|
| armeabi-v7a | 10.0 Mb |
| arm64-v8a | 10.5 Mb |
| universal | 20.4 Mb |
#
If you are using **VideoIdentification** entry mode, also include:
**Note**: The average sizes were measured by building the minimum possible wrappers around our SDK.
Different versions of the dependencies, such as Gradle or NDK, may result in slightly different values.
#### Multi-APK split
C++ code needs to be compiled for each of the CPU architectures (known as "ABIs") present on the Android environment. Currently, the SDK supports the following ABIs:
*`armeabi-v7a`: Version 7 or higher of the ARM processor. Most recent Android phones use this
*`arm64-v8a`: 64-bit ARM processors. Found on new generation devices
*`x86`: Used by most tablets and emulators
*`x86_64`: Used by 64-bit tablets
The SDK binary contains a copy of the native `.so` file for each of these four platforms.
You can considerably reduce the size of your `.apk` by applying APK split by ABI, editing your `build.gradle` to the following:
```gradle
android{
splits{
abi{
enabletrue
reset()
include'x86','x86_64','arm64-v8a','armeabi-v7a'
universalApkfalse
}
}
}
```
Read the [Android documentation](https://developer.android.com/build/configure-apk-splits) for more information.
### 1.3 Permissions
Add following lines to the **_AndroidManifest.xml_**:
valconfig=MyIdConfig.Builder(clientId=/* Your client id */)
.withClientHash(/* Your clientHash */, /* Your clientHashId */)
.withPassportData(passportData)
.withBirthDate(dateOfBirth)
.withEnvironment(MyIdEnvironment.Production)
.build()
/*
Start the flow. 1 should be your request code (customize as needed).
Must be an Activity or Fragment (support library).
This request code will be important for you on onActivityResult() to identify the MyIdResultListener.
*/
client.startActivityForResult(this,1,config)
}
}
```
### 1.1 Methods
Method | Notes | Default
--- | --- | ---
`withClientHash(clientHash: String, clientHashId: String)` | Provided by MyID sales team | Mandatory, if using withEntryType(MyIdEntryType.Identification)
`withPassportData(passportData: String)` | Passport serial number or PINFL data | Optional
`withBirthDate(dateOfBirth: String)` | Date of birth. Format: `dd.MM.yyyy` | Optional
`withSoundGuides(enable: Boolean)` | To set sound guides | true
`withErrorScreen(showErrorScreen: Boolean)` | Customizing the SDK error screens | true
`withHuaweiAppId(appId: String)` | To set a huawei app id | Required for HMS
**Note 1.1.** You can customize the screen for entering passport data and date of birth in your
application, in which case you can pass these parameters during initialization to the SDK, otherwise
the SDK requires the input of passport data and date of birth for user identification.
**Note 1.2.** If the `sdk_hash` is empty, blank or string with length other than 32 has been provided, we will continue showing the credentials screen.
**Note 1.3.** If the `externalId` is not empty, has a length of 36 characters and corresponds to the regular expression UUID4, we will not display a [recommendation](images/screen01.jpg) screen. If a certain number of unsuccessful identification attempts (currently set to 5) occur in MyID within one hour and the `externalId` is not empty, SDK returns to the parent app error message as `message` in `MyIdException`.
**Note 1.4.**`MyIdEnvironment` contains **Debug** and **Production** modes.
-**Debug** is used to sandbox.
-**Production** is used to production.
**Note 1.5.**`MyIdEntryType` contains **Identification**, **VideoIdentification** and **FaceDetection** types.
-**Identification** is used to identify the user through the MyID services.
-**VideoIdentification** is used to identify the user through the MyID services. Requires the `myid-video-capture-sdk` dependency.
-**FaceDetection** is used to detect a face and returns a picture (bitmap).
**Note 1.7.** If the user sends a **passport data** to the SDK, the **residency** must be handled by the **client**. If `residency = MyIdResidency.UserDefined` is sent, the SDK will treat the user as **Non-Resident**.
**Note 1.8.** If the SDK **does not receive a passport data** and receives `residency = MyIdResidency.UserDefined`, the SDK displays the **MyID passport input screen**. If the user enters a **PINFL**, the screen will show a **checkbox** allowing the user to select **Resident** or **Non-Resident**.
Due to the advanced validation support (in C++ code), we recommend that the integrator app performs [multi-APK split](#multi-apk-split) to optimize the app size for individual architectures.
Average size (with Proguard enabled):
| ABI | Size |
|-------------|:--------:|
| armeabi-v7a | 28.7 Mb |
| arm64-v8a | 23.3 Mb |
| universal | 37.2 Mb |
#
If you are using **VideoIdentification** entry mode, also include:
**Note**: The average sizes were measured by building the minimum possible wrappers around our SDK.
Different versions of the dependencies, such as Gradle or NDK, may result in slightly different values.
#### Multi-APK split
C++ code needs to be compiled for each of the CPU architectures (known as "ABIs") present on the Android environment. Currently, the SDK supports the following ABIs:
*`armeabi-v7a`: Version 7 or higher of the ARM processor. Most recent Android phones use this
*`arm64-v8a`: 64-bit ARM processors. Found on new generation devices
*`x86`: Used by most tablets and emulators
*`x86_64`: Used by 64-bit tablets
The SDK binary contains a copy of the native `.so` file for each of these four platforms.
You can considerably reduce the size of your `.apk` by applying APK split by ABI, editing your `build.gradle` to the following:
```gradle
android{
splits{
abi{
enabletrue
reset()
include'x86','x86_64','arm64-v8a','armeabi-v7a'
universalApkfalse
}
}
}
```
Read the [Android documentation](https://developer.android.com/build/configure-apk-splits) for more information.
### 1.3 Permissions
Add following lines to the **_AndroidManifest.xml_**:
valconfig=MyIdConfig.Builder(sessionId=/* Your session id */)
.withClientHash(/* Your clientHash */, /* Your clientHashId */)
.withEnvironment(MyIdEnvironment.Production)
.build()
/*
Start the flow. 1 should be your request code (customize as needed).
Must be an Activity or Fragment (support library).
This request code will be important for you on onActivityResult() to identify the MyIdResultListener.
*/
client.startActivityForResult(this,1,config)
}
}
```
### 1.1 Methods
Method | Notes | Default
--- | --- | ---
`withClientHash(clientHash: String, clientHashId: String)` | Provided by MyID sales team | Mandatory, if using withEntryType(MyIdEntryType.Identification)
`withResidency(residency: MyIdResidency)` | To set a specific residency type | MyIdResidency.Resident
`withMinAge(age: Int)` | To set a specific minimum age to use MyID service | 16
`withDistance(distance: Float)` | To set a specific distance for taking photo | 0.65
**Note 1.4.** If the SDK **does not receive a passport data** and receives `residency = MyIdResidency.UserDefined`, the SDK displays the **MyID passport input screen**. If the user enters a **PINFL**, the screen will show a **checkbox** allowing the user to select **Resident** or **Non-Resident**.