UI - ReconoSERID/SDK-ReconoSERID-Android GitHub Wiki
UI
Graphical interface for Facial and Document Biometrics services.
Depending on the type of agreement certain parameters are mandatory to be sent in the intent
-
For type 0:
"guid_citizen" must be sent as key accompanied by the guidCitizen 2.
-
For type 3:
Must be sent as key "type_document" accompanied by the document type 2. 2. Must be sent as key "num_document" together with the document number.
Document front side ### Document back side ###
Captures the document on the front side, valid for Colombian cedulas since it validates that there is a face and that it says "cedula de Colombia".
#!java
Intent intent = new Intent(this, RequestDocumentActivity.class);
intent.putExtra(IntentExtras.TEXT_SCAN, "Anverso");
intent.putExtra(IntentExtras.CITIZEN_GUID, "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"); //Mandatory for agreement 0
intent.putExtra(IntentExtras.TYPE_DOCUMENT, "CC"); //Mandatory for agreement 3
intent.putExtra(IntentExtras.NUM_DOCUMENT, "123456789"); //Obligatory for agreement 3
intent.putExtra(IntentExtras.SAVE_USER, "xxxx"); //Mandatory for agreement 0
startActivityForResult(intent, DOCUMENT_REQUEST);
The call is made by intent and must be passed Overhead
and static final int DOCUMENT_REQUEST = 1;
and you get the response in the onActivityResult
#!java
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
binding.btnIntent.setEnabled(true);
if (requestCode == DOCUMENT_REQUEST){
if (resultCode == RESULT_OK){
data.getParcelableExtra(IntentExtras.DATA_DOCUMENT) //data read from the document
data.getStringExtra(IntentExtras.PATH_FILE_PHOTO) //path of the taken image
} else if (resultCode == IntentExtras.ERROR_INTENT){
data.getStringExtra(IntentExtras.ERROR_MSG) //error message
data.getExtras().getParcelable(IntentExtras.ERROR_SDK) //errors generated in the SDK
}
}
}
Document Reverse side ### Document Reverse side ###
Captures the document on the reverse side, valid for Colombian cédulas since it validates that it says "DATE OF BIRTH".
#!java
static final int DOCUMENT_REQUEST = 1;
Intent intent intent = new Intent(this, RequestDocumentActivity.class);
intent.putExtra(IntentExtras.TEXT_SCAN, "Reverse");
intent.putExtra(IntentExtras.CITIZEN_GUID, "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"); //Mandatory for agreement 0
intent.putExtra(IntentExtras.TYPE_DOCUMENT, "CC"); //Mandatory for agreement 3
intent.putExtra(IntentExtras.SAVE_USER, "xxxx"); //Mandatory for agreement 0
intent.putExtra(IntentExtras.NUM_DOCUMENT, "123456789"); //Obligatory for agreement 3
startActivityForResult(intent, DOCUMENT_REQUEST);
The result is returned in the onActivityResult
#!java
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
binding.btnIntent.setEnabled(true);
if (requestCode == DOCUMENT_REQUEST){
if (resultCode == RESULT_OK){
data.getExtras().getParcelableExtra(IntentExtras.DATA_DOCUMENT)
} else if (resultCode == IntentExtras.ERROR_INTENT){
onErrorIntent(data);
}
}
}
Document
Parameter | Type | Description |
---|---|---|
documentOverleaf | DocumentOverleaf | Data Overleaf |
documentReverse | DocumentReverse | DocumentReverse |
path | String | Path Photo cache |
typeDocument | String | DocumentType |
stateDocument | String | String |
textScan | String | All the text obtained by reading the document |
documentValidations | DocumentValidations | Validations performed |
typeDocument
- Colombian ID card front side = 1
- Colombian ID card reverse = 2
- Colombian ID card front = 3
- Identity card reverse = 4 Ecuadorian ID card front = 5 * Ecuadorian ID card back = 5
- Ecuadorian document reverse = 6
**StateDocument
- 0 : no front and no back
- 1 : only front side evaluated
- 2 : only reverse side evaluated
- 3 : both front and back evaluated
Document Barcode
Reads the barcode of the Colombian cedulas and returns a string.
#!java
static final int BARCODE_DOCUMENT = 2;
Intent intent intent = new Intent(this, BarCodeActivity.class);
startActivityForResult(intent, BARCODE_DOCUMENT);
The result is returned in the onActivityResult
#!java
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
binding.btnIntent.setEnabled(true);
if (requestCode == BARCODE_DOCUMENT){
if (resultCode == RESULT_OK) {
data.getStringExtra(IntentExtras.DATA_BARCODE); //string of the barcode
}
else if (resultCode == IntentExtras.ERROR_INTENT){
onErrorIntent(data);
}
}
}
Facial Biometry ### Facial Biometry ###
Validates that a human face is present and performs random movements (smile, blink, turn right or left).
Depending on the type of agreement certain parameters are mandatory to be sent in the intent
-
For type 0:
"guid_citizen" must be sent as key accompanied by the guidCitizen 2.
-
For type 3:
Must be sent as key "type_document" accompanied by the document type 2. 2. Must be sent as key "num_document" together with document number
#!java
static final int FACE = 3;
Intent intent intent = new Intent(this, LivePreviewActivity.class);
intent.putExtra(IntentExtras.CITIZEN_GUID, "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx"); //Mandatory for convention 0
intent.putExtra(IntentExtras.TYPE_DOCUMENT, "CC"); //Obligatory for agreement 0 and 3
intent.putExtra(IntentExtras.NUM_DOCUMENT, "123456789"); //Obligatory for agreement 0 and 3
intent.putExtra(IntentExtras.SAVE_USER, "xxxx"); //Mandatory for agreement 0
intent.putExtra(IntentExtras.VALIDATE_FACE, false); //Obligatory for convention 0 if you send true the face is validated
startActivityForResult(intent, FACE);
is returned in the onActivityResult
#!java
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
binding.btnIntent.setEnabled(true);
if (requestCode == FACE){
if (resultCode == RESULT_OK){
data.getStringExtra(IntentExtras.PATH_FILE_PHOTO_R) //path picture taken
data.getStringExtra(IntentExtras.VALIDATE_FACE) //if you sent true in intent IntentExtras.VALIDATE_FACE
}else if (resultCode == IntentExtras.ERROR_INTENT){
data.getStringExtra(IntentExtras.ERROR_MSG) //error message
data.getExtras().getParcelable(IntentExtras.ERROR_SDK) //errors generated in the SDK
}
}
}