TuIDAddressKit(Android) v0.0.12

This library makes it possible to capture a frontal image of a "Proof of address CFE" that corresponds to the main side of the receipt. Send them to the Address service to verify the captured document. This document is specifically aimed at technical level users who require information about Tu Identidad “Address” SDK.

Requirements

Android Studio 3.5. +
Android OS 5.0+ Arquitectura -armv7, arm64

Credentials

ApiKey: previously delivered by Tu identidad.

Technology

IdValidation SDK (Android) was developed in Java.
• Java
• Android Studio 3.5.1

SDKs document preferences

Format

Type Format Size Weight
Document front image .JPEG, .PNG, .JPG for attached files. About 800px x 1000px 4MB as maximum.
Characteristic Description
Focused The image must be focused and show readable information for the correct execution of the OCR process.
Brightness The image must not show glare of light, excess brightness or contrast alterations that cause error in the validation of authenticity.
Quality The document must have legibility characteristics, not be altered, not present physical damage or alterations that prevent the reading of the information and execution of the validations.
Figure The image should preferably be in the shape of a rectangle, where only the Proof of address CFE is shown without excessive background.

Methods

Azure dependency:

Dependency that is instantiated in the Gradle root to access the Tu Identidad Address repository.

maven {
  url 'https://jitpack.io'
}
maven {
  url 'https://pkgs.dev.azure.com/tu-identidad/TuIdentidad-Android-SDK/_packaging/Address-SDK/maven/v1'
}

Library implementation

Dependency that is instantiated in the Gradle app that calls the Tu identidad Address library.

{
  implementation 'com.tuidentidad.sdk:TuIDAddressKit:0.0.12'
}

Intent to send necessary parameters:

int requestCode;
Intent i = new Intent(MainActivity.this,AddressDocumentActivity.class);
i.putExtra("ApiKey",”Your-Api-Key”);
startActivityForResult(i,requestCode);

Parameters

The intent takes as parameters: the context of the main class, "ApiKey".

onActivityResult method instance

Method required to get the data from the SDK.

{
 @RequiresApi(api = Build.VERSION_CODES.R)
protected void onActivityResult(int requestCode, int resultCode, Intent data){
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_OK){
Bundle extras = data.getExtras();
// Get status
Boolean status = extras.getBoolean("status");
String response = extras.getString("response");
String error = extras.getString("errorData");
Uri frontCFEPath = extras.getParcelable("cfeimgPath");
Bitmap bitmapCFE = null;
// Get Image
try {
bitmapCFE = MediaStore.Images.Media.getBitmap(this.getContentResolver(),frontCFEPath);
    frontImageViewCFE.setImageBitmap(bitmapCFE);
    }catch(FileNotFoundException e) {
            e.printStackTrace();
      }
// Check validation status
if(status == false){
    Toast.makeText(getApplicationContext(), error, Toast.LENGTH_SHORT).show();
    }
    else{
    Toast.makeText(getApplicationContext(), response, Toast.LENGTH_SHORT).show();
      }
    }
  }
}