In this section, you will find all the necessary information to implement the Android SDK of the Unico IDCloud platform
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
In this section, you will find all the necessary information for handling errors from the Unico IDCloud SDK in your Android applications
ErrorBio
ObjectThis object is returned whenever an error occurs in the Android SDK.
Method Name | Description |
---|---|
Below is a list of possible error codes from the Android SDK:
Code | Description |
---|---|
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.
getCode()
Method used to obtain the error code that occurred.
getDescription()
Method used to obtain the description of the error that occurred.
73001
Context invalid
73002
Did not grant permission to open camera
73003
The lest API is 21(LOLLIPOP)
73004
Could not find implementation interface callback iAcessoBioSelfie
73005
Could not find implementation interface callback iAcessoBioDocument
73006
Unable to open camera on emulators
73100
Unable to connect to internet
73200
Please inform the json file name
73202
Unable to parse json file
73300
Unable to get unico authentication object
73301
Unable to parse object
73302
Could not find the unico token
73303
Current host is not registered
73400
Could not initialize camera
73500
Unable to get session token, service response error
73501
Unable to parce object
73502
Could not get session token
73701
Could not find active liveness import
73702
Unable to initialize active liveness in production mode
73703
Unable to get active liveness session
73704
The user pressed the cancel button and did not complete the Session.
73705
The Session was not performed successfully and a FaceScan was not generated. In general, other statuses will be sent to the
73706
The camera access is prevented because either the user has explicitly denied permission or the user's device is configured to
73707
The Session was cancelled due to the app being terminated, put to sleep, an OS notification, or the app was placed in the
73708
The Session was cancelled because device is in landscape mode. The user experience of devices in these orientations is poor
73709
The Session was cancelled because device is in reverse portrait mode. The user experience of devices in these orientations is
73710
The Session was cancelled because the user was unable to complete a Session in the default allotted time or the timeout set
73712
The Session was cancelled due to memory pressure.
73712
The Session was cancelled because your App is not in production and requires a network connection.
73713
The Session was cancelled because your key needs to be validated again.
73714
The Session was cancelled because the developer-configured encryption key was not valid.
73715
The Session was cancelled because not all guidance images were configured.
73716
The Session was cancelled because SDK was unable to start the camera on this device.
73717
The Session was cancelled because the user was in a locked out state.
73718
The Session was cancelled because of an unknown and unexpected error. SDK leverages a variety of iOS APIs including camera,
73719
The Session cancelled because user pressed the Get Ready screen subtext message. Note: This functionality is not available by
73800
Could not build encrypted key
In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your Android applications
In this section, you will find all the necessary information for using and integrating the Unico IDCloud platform SDK into your Android applications for selfie capture
This guide has been designed to help you quickly and easily implement the Android SDK. Below, you'll find the step-by-step process for the complete integration. If you wish to customize the experience further, check out the Android Customization section.
Create an instance of the builder (generated through the IAcessoBioBuilder
interface), providing the relevant context and implementing the AcessoBioListener
class. The implementation of this class is straightforward and can be achieved with just a few lines of code. Simply instantiate the builder with the relevant context and override the callback methods with your application’s business logic:
Configure the environment that will be used to run the SDK. Use the enumerated environment that contains the following enumerates:
Environment.PROD
: for production environment;
Environment.UAT
: for approval environment.
See how to implement it in the example below:
Note that implementing the AcessoBioListener
class is largely about setting up callback methods. Each method is triggered in a specific SDK return scenario. Override the methods exemplified above with your application’s business logic.
onErrorAcessoBio(ErrorBio errorBio)
This method is invoked whenever any implementation error occurs using any SDK method. It receives an ErrorBio
parameter that contains error details. See the Error Handling section for more about ErrorBio
.
onUserClosedCameraManually()
This method is invoked when the user manually closes the camera, such as by clicking the "Back" button.
onSystemClosedCameraTimeoutSession()
This method is invoked when the maximum session time is reached (without capturing an image).
You can configure the session timeout in seconds using setTimeoutSession
. The default and minimum timeout is 40 seconds.
onSystemChangedTypeCameraTimeoutFaceInference()
This method is invoked when the maximum time for face detection is reached without detection.
The maximum time is 13 seconds. The mode is then switched to manual capture to facilitate the user’s action.
All the above methods must be created as indicated in your project (even without any logic); otherwise, the project won’t compile successfully.
The SDK is preconfigured with intelligent framing and automatic capture. Configure the camera mode in the builder as follows:
The false/true
values in the above methods do not alter the capture experience; they are solely used for the SDK's internal logic.
Implement these listener methods using an instance of the iAcessoBioSelfie
class
The camera opening method, which is called in the next step, needs to know what to do when an image is successfully captured or if an error occurs in the process. You must specify "what to do" in the camera opening method by implementing listeners, which are triggered in success or error situations.
Through listener configuration, you can define what happens in your app in cases of an error (onErrorSelfie
method) or success (onSuccessSelfie
method) when capturing images.
To configure the listeners, you need to implement:
onSucessSelfie
MethodUpon successful image capture, this method returns a ResultCamera
object for subsequent API requests:
The ResultCamera
object provides two attributes: base64
and encrypted
:
Use base64
for preview in the app;
Use encrypted
for sending to REST APIs.
The encrypted
attribute is strictly intended for sending the image through the by Client APIs. It should not be opened or serialized, as its characteristics may change without prior notice. Its use must be exclusive to interactions with the APIs to ensure the integrity and security of the data. Unico is not responsible for any damages arising from this practice, as modifications may occur unexpectedly.
The base64
and encrypted
files can vary in size due to several factors, including the quality of the devices and the photos generated, as well as Unico's business rules. To avoid issues in your application, do not restrict the size of the string generated by the SDK for these files in your programming logic or infrastructure.
If it is necessary to convert the base64 string to a bitmap, the standard method does not work for Android. You need to perform a split at the comma (,) for it to function correctly. If you want to learn more, read the article: How to convert a Base64 string into a Bitmap image to show it in a ImageView?.
onErrorSelfie
MethodIf an error occurs during image capture, this method returns an ErrorBio
object
Learn more about ErrorBio
types in the SDK Error Handling section.
The openCameraSelfie method is used to open the camera. This method receives as a parameter the implementation of the UnicoSelfie class and the JSON with the credentials, generated in the step above.
The following example illustrates the steps for configuring listeners and opening the camera:
After capturing images, the next step is to send the generated encrypted
image from the SDK to the Client APIs.
For security reasons, the interval between the generation of the encrypted data and the sending through one of the available flows must be no more than 10 minutes. Submissions made beyond this period will be automatically rejected by the API.
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.
In this section, you will find solutions to some common issues encountered during the integration of the Unico IDCloud SDK into your Android applications
The obfuscation material aims to assist developers in navigating obfuscation issues in their applications. The client's obfuscator can affect the SDK's functionality; therefore, it is essential that it does not obfuscate the SDK code. Unico disclaims any responsibility regarding obfuscation conflicts with the SDK.
Obfuscation is a process of transforming bytecode into a form that is less readable to humans, thereby making reverse engineering more difficult. This process involves removing debugging-related information such as variable tables, line numbers, and renaming packages, classes, and methods. When integrating the Android SDK into an application, failures may occur.
When obfuscation is performed using DexGuard, if a failure occurs, use the following rules:
When obfuscation is performed using ProGuard, if a failure occurs, use the following rules:
Starting from version 4.4.x of the SDK, Unico began using its own Maven repository to distribute the Android SDK and changed the SDK dependency name, in addition to adjustments to ProGuard and DexGuard rules for clients using the GuardSquare library, as described in the Code Obfuscation section above.
Change the Maven repository to the new repository in the project’s build.gradle
file. The implementation was previously done as follows:
It should now be updated to the new repository:
Update the SDK dependency to the new dependency in the project’s app/build.gradle
file. The implementation was previously done as follows:
It should now be updated to the new dependency:
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.
In this section, you will find all the information necessary for customizing the SDK of the Unico IDCloud platform in your Android applications
The Android SDK allows for some customizations to be made. Below are all the possible customizations for this SDK.
It is possible to configure the experience of the informational messages in the capture frames by changing their language. Use the enumerated type LocaleTypes
, which contains the following values:
LocaleTypes.PT_BR
: for Portuguese(Brazil);
LocaleTypes.ES_MX
: for Spanish(Mexico);
LocaleTypes.ES_ES
: for Spanish(Spain);
LocaleTypes.EN_US
: for English(USA).
See how to implement it in the example below:
A remote activation may be required to be used, if you wish to use it, notify your project manager or Unico support.
If not configured, the SDK will use Portuguese as the default language.
This is an optional step, but it is highly recommended to give the capture process the visual identity of your company.
You can customize some objects in the frame according to the camera mode used through the setTheme()
method.
The supported types for color representation are Color Resource or a String containing the hexadecimal color code. E.g., R.color.red
or #FF0000
.
All methods are available below:
It is also possible to make static customizations. In your colors.xml
file, add the following code:
Below, check the specification of the customization fields:
This is an optional step, but it is highly recommended to give the capture process the visual identity of your company.
You can customize some objects in the frame according to the camera mode used through the setTheme()
method.
The supported types for color representation are Color Resource or a String containing the hexadecimal color code. E.g., R.color.red
or #FF0000
.
All methods are available below:
It is also possible to make static customizations. In your colors.xml
file, add the following code:
Below, check the specification of the customization fields:
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.
In this section, you will find all the necessary information for using and integrating the Unico IDCloud SDK into your Android applications for document capture
This guide has been designed to help you implement the Android SDK quickly and easily. Below, you will find a step-by-step process for the entire integration. After that, if you wish to customize the experience, be sure to check the Android Customization section.
In this camera mode, there is a capture frame to assist the user in positioning the document correctly. Once the document is properly positioned, the user must click the button to take a photo of the document.
The SDK does not perform any validation of what is being captured.
In this camera mode, it is possible to capture the following documents:
CPF: Capture the front of the CPF;
CNH: Capture the open CNH;
CNH Front: Capture the front of the CNH;
CNH Back: Capture the back of the CNH;
RG Front: Capture the front of the RG;
RG Back: Capture the back of the RG;
Others: Capture any other document.
Create an instance of the builder (generated through the IAcessoBioBuilder
interface), providing the relevant context as a parameter and implementing the AcessoBioListener
class. The implementation of this class is quite simple and can be done with just a few lines of code. All you need to do is instantiate the builder, specifying the relevant context and overriding the callback methods with your application's business logic:
Note that the implementation of the AcessoBioListener
class largely consists of configuring the callback methods. Each method is called in a specific situation based on the SDK's return.
Override the methods exemplified above with your application’s business logic.
onErrorAcessoBio(ErrorBio errorBio)
This method is invoked with a parameter of type ErrorBio
that contains details about the error. Learn more about the ErrorBio
type in the error handling section.
onUserClosedCameraManually()
This method is invoked whenever the user manually closes the camera, such as by clicking the "Back" button.
onSystemClosedCameraTimeoutSession()
This method is invoked once the maximum session time is reached (without capturing any image).
You can configure the session timeout in seconds using setTimeoutSession
. The default and minimum timeout is 40 seconds.
onSystemChangedTypeCameraTimeoutFaceInference()
This method is invoked when the maximum time for face detection is reached without detection.
The maximum time is 13 seconds. The mode is then switched to manual capture to facilitate the user’s action.
All the above methods must be created as indicated in your project (even without any logic); otherwise, the project won’t compile successfully.
The implementation of these listener methods should be done through an instance of the iAcessoBioSelfie
class.
The camera opening method, which is called in the next step, needs to know what to do upon successfully capturing an image or encountering an error during the process. It is necessary to inform "what to do" to the camera opening method by implementing listeners that are called in success or error situations.
By configuring the listeners, you can specify what happens in your app in case of an error (method onErrorDocument
) or success (method onSuccessDocument
) in capturing images. The example below illustrates the configuration of the listeners, building, and opening the camera:
onSucessDocument
MethodWhen successfully capturing an image, this method is invoked and returns an object of type ResultCamera
, which is used later in the REST API requests:
The ResultCamera
object returns two attributes: base64
and encrypted
.
The base64
attribute can be used if you want to display a preview of the image in your app.
Both the encrypted
and base64
attributes can be sent in the REST API calls of the by Client.
If it is necessary to convert the base64 string to a bitmap, the standard method does not work for Android. You need to perform a split at the comma (,) for it to function correctly. If you want to learn more, read the article: How to convert a Base64 string into a Bitmap image to show it in a ImageView?.
onErrorDocument
MethodIf an error occurs during the image capture, this method is invoked and returns an object of type ErrorBio
:
Learn more about the types of ErrorBio
in the SDK's error handling section.
It is necessary to create an instance of the builder using the build()
method. This method is provided by the object generated with the IAcessoBioBuilder
interface and the AcessoBio
class:
The next step is to prepare the camera using the prepareDocumentCamera()
method with the object returned by the builder (named UnicoCheckCamera
in the example above). The prepareDocumentCamera()
method generates an object of type UnicoCheckCameraOpener.Document
, which is used to open the camera with its open()
method, receiving the type of document to be captured as a parameter:
If you need to capture a document for which there is no specific frame (e.g., RNE, among others), use the DocumentCameraType.None
frame, which will allow you to use a generic rectangular frame to guide any capture.
After capturing images, the next step is to send the generated base64
image from the SDK to the Client APIs.
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our Help Center.
In this section, you will find all the information needed to install the Unico IDCloud platform SDK in your Android applications
Ensure your development environment meets the following preconditions:
The capture component provided through the Android SDK supports versions equal to or higher for the following technologies:
Android: 5.0 (API 21);
Kotlin: 1.6.
This SDK does not function on emulators, it is only supported on physical devices.
The Android SDK is compatible with the vast majority of devices running Android 5.0 (API level 21) or higher.
The table below lists the devices tested in our lab, along with the availability of vendor/manufacturer extensions. Some listed extensions may be subject to specific manufacturer APIs or SKUs. Click below to view the tested devices:
To implement the Unico IDCloud platform’s Android SDK in your Android app, follow the steps below:
The Android SDK is available via a Maven repository. Add it to the repositories
block in the root-level build.gradle
file:
Enable AndroidX support in your gradle.properties
file in the root of your project. This ensures better performance and proper functioning of the capture framework.
After configuring the Android SDK, import it into your project by adding acessobio-android
to the dependencies
block in app/build.gradle
.
Use the module-specific build.gradle
file, not the project-level one:
If you encounter the error:
Invoke-customs are only supported starting with android 0 --min-api 26
Add the following lines to the compileOptions
block in app/build.gradle
:
Contact the CSs and/or Onboarding team.
Request the SDK Key by entering the identifiers of your applications. Bundle Identifier for iOS, PackageID for Android and Host for WEB.
The identifiers of your applications will be linked to the SDK Key by the Unico team.
You receive your SDK Key to implement the AccessBioConfigDataSource.
Once the SDK installation is complete, proceed to the implementation by reading the following Usage and Integration Guide:
In this section, you will find all the updates for the Unico IDCloud Android SDK
Keep your Android SDK always up to date with the latest available version. Semantic versioning is used to number the versions. For more information, please refer to the article Overview.
Update SDK and Server version of Liveness with interaction.
Update SDK and Server version of Liveness with interaction.
SDK Update and Liveness Server Interaction;
Internal Improvements.
Parameter | Description |
---|---|
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our .
Still need help?
Didn't find something or still need help? If you're already a client or partner, you can reach out through our .
DocumentCameraType.CPF
Capture the front of the CPF
DocumentCameraType.CNH
Capture the open CNH
DocumentCameraType.CNH_FRENTE
Capture the front of the CNH
DocumentCameraType.CNH_VERSO
Capture the back of the CNH
DocumentCameraType.RG_FRENTE
Capture the front of the RG
DocumentCameraType.RG_VERSO
Capture the back of the RG
DocumentCameraType.None
Capture any other document
|
|
ASUS - X01BDA | 10.0.0 | Físico |
ASUS - Z01KD | 8.0.1 | Físico |
HUAWEY - P30 Lite | 9.0.0 | Físico |
LG - K22 | 10.0.0 | Físico |
LG - Q6 | 7.0.0 | Físico |
MOTOROLA - Moto one macro | 10.0.0 | Físico |
MOTOROLA - Moto G4 | 6.0.1 | Físico |
MOTOROLA - Moto G5s Plus | 8.1.0 | Físico |
MOTOROLA - Moto G6 Play | 9.0.0 | Físico |
MOTOROLA - Moto G7 Play | 10.0.0 | Físico |
MOTOROLA - Moto G7 Power | 10.0.0 | Físico |
MOTOROLA - Moto G8 Power Lite | 10.0.0 | Físico |
SAMSUNG - A01 | 10.0.0 | Físico |
SAMSUNG - J8 SM J810M | 8.1.0 | Físico |
SAMSUNG - Galaxy A30s SM-A307GT | 10.0.0 | Físico |
SAMSUNG - Galaxy A51 | 10.0.0 | Físico |
SAMSUNG - Galaxy A71 | 11.0.0 | Físico |
SAMSUNG - Galaxy S20+ | 11.0.0 | Físico |
SAMSUNG - s10e | 11.0.0 | Físico |
XIAOMI - Mi 8 Lite | 9.0.0 | Físico |
XIAOMI - Mi 8 Lite | 10.0.0 | Físico |
XIAOMI - Poco X3 | 10.0.0 | Físico |
XIAOMI - Redmi Note 8 | 10.0.0 | Físico |
XIAOMI - Redmi Note 8 Pro | 10.0.0 | Físico |
XIAOMI - Redmi Note 9 | 10.0.0 | Físico |
XIAOMI - Redmi Note 9 Pro | 10.0.0 | Físico |
GOOGLE - Pixel sailfish | 8.0.0 | Virtual (TestLab) |
HUAWEY - ALE L23 | 5.0.0 | Virtual (TestLab) |
HUAWEY - ANE LX1 | 9.0.0 | Virtual (TestLab) |
HUAWEY - ANE LX2 | 9.0.0 | Virtual (TestLab) |
HUAWEY - COR L29 | 8.1.0 | Virtual (TestLab) |
HUAWEY - MHA L29 | 7.0.0 | Virtual (TestLab) |
HUAWEY - NEO L29 | 9.0.0 | Virtual (TestLab) |
SAMSUNG - SC 02J | 8.0.0 | Virtual (TestLab) |
SAMSUNG - SM G891A | 9.0.0 | Virtual (TestLab) |
SAMSUNG - SM G930AZ | 8.0.0 | Virtual (TestLab) |
SAMSUNG - SM G935A | 8.0.0 | Virtual (TestLab) |
SAMSUNG - SM G965N | 9.0.0 | Virtual (TestLab) |
SAMSUNG - SM G965U1 | 8.0.0 | Virtual (TestLab) |
SAMSUNG - SM G981U1 | 10.0.0 | Virtual (TestLab) |
SAMSUNG - SM J727V | 8.1.0 | Virtual (TestLab) |
SAMSUNG - SM N950F | 9.0.0 | Virtual (TestLab) |
SAMSUNG - SM N950N | 9.0.0 | Virtual (TestLab) |
SAMSUNG - SM N950U | 8.0.0 | Virtual (TestLab) |
SAMSUNG - SM N960F | 9.0.0 | Virtual (TestLab) |
SAMSUNG - SM N960N | 9.0.0 | Virtual (TestLab) |
SAMSUNG - SM N960U1 | 8.1.0 | stLab) |
version 9 or higher installed (the official development IDE from Google);