# Getting results

## Text Results

If you know exactly what [text data](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) are needed, the fastest way to get information is to use special functions.

### Getting values

Getting values of [text fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/evisualfieldtype):

{% tabs %}
{% tab title="Java" %}

```java
// Get full name
String surnameAndGivenNames = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES);
// Get date of birth
String dateOfBirth = results.getTextFieldValueByType(eVisualFieldType.FT_DATE_OF_BIRTH);
// Get document number
String documentNumber = results.getTextFieldValueByType(eVisualFieldType.FT_DOCUMENT_NUMBER);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get full name
val surnameAndGivenNames = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES)
// Get date of birth
val dateOfBirth = results.getTextFieldValueByType(eVisualFieldType.FT_DATE_OF_BIRTH)
// Get document number
val documentNumber = results.getTextFieldValueByType(eVisualFieldType.FT_DOCUMENT_NUMBER)
```

{% endtab %}
{% endtabs %}

Getting values of [text fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/evisualfieldtype)*,* [*lcid*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/lcid):

{% tabs %}
{% tab title="Java" %}

```java
// Get full name
String surnameAndGivenNames = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, LCID.BELARUSIAN);
// Get place of birth
String placeOfBirth = results.getTextFieldValueByType(eVisualFieldType.FT_PLACE_OF_BIRTH, LCID.GERMAN_GERMANY);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get full name
val surnameAndGivenNames = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, LCID.BELARUSIAN)
// Get place of birth
val placeOfBirth = results.getTextFieldValueByType(eVisualFieldType.FT_PLACE_OF_BIRTH, LCID.GERMAN_GERMANY)
```

{% endtab %}
{% endtabs %}

Getting values of [text fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/evisualfieldtype)*,* [*lcid*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/lcid)*,* [*source*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_resulttype):

{% tabs %}
{% tab title="Java" %}

```java
// Get full name
String surnameAndGivenNames = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, LCID.BELARUSIAN, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED);
// Get address
String address = results.getTextFieldValueByType(eVisualFieldType.FT_ADDRESS, LCID.LATIN, eRPRM_ResultType.RPRM_RESULT_TYPE_BAR_CODES_TEXT_DATA);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get full name
val surnameAndGivenNames = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, LCID.BELARUSIAN, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED)
// Get address
val address = results.getTextFieldValueByType(eVisualFieldType.FT_ADDRESS, LCID.LATIN, eRPRM_ResultType.RPRM_RESULT_TYPE_BAR_CODES_TEXT_DATA)
```

{% endtab %}
{% endtabs %}

Getting values of [text fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/evisualfieldtype)*,* [*lcid*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/lcid)*,* [*source*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_resulttype)*, original*:

{% tabs %}
{% tab title="Java" %}

```java
// Get surname
String surname = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME, LCID.BELARUSIAN, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, true);
// Get address
String address = results.getTextFieldValueByType(eVisualFieldType.FT_ADDRESS, LCID.LATIN, eRPRM_ResultType.RPRM_RESULT_TYPE_BAR_CODES_TEXT_DATA, true);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get surname
val name = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME, LCID.BELARUSIAN, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, true)
// Get address
val address = results.getTextFieldValueByType(eVisualFieldType.FT_ADDRESS, LCID.LATIN, eRPRM_ResultType.RPRM_RESULT_TYPE_BAR_CODES_TEXT_DATA, true)
```

{% endtab %}
{% endtabs %}

Getting values of [text fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/evisualfieldtype)*,* [*source*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_resulttype):

{% tabs %}
{% tab title="Java" %}

```java
// Get surname
String surname = results.getTextFieldValueByTypeAndSource(eVisualFieldType.FT_SURNAME, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get surname
val surname = results.getTextFieldValueByTypeAndSource(eVisualFieldType.FT_SURNAME, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED)
```

{% endtab %}
{% endtabs %}

Getting values of [text fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/evisualfieldtype)*,* [*source*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_resulttype)*, original*:

{% tabs %}
{% tab title="Java" %}

```java
// Get surname
String surname = results.getTextFieldValueByTypeAndSource(eVisualFieldType.FT_SURNAME, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, true);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get surname
val surname = results.getTextFieldValueByTypeAndSource(eVisualFieldType.FT_SURNAME, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, true)
```

{% endtab %}
{% endtabs %}

You can also go through all instances of [text fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) and obtain the desired information, e.g.:

{% tabs %}
{% tab title="Java" %}

```java
for(DocumentReaderTextField textField : results.textResult.fields) {
    String value = results.getTextFieldValueByType(textField.fieldType, textField.lcid);
    Log.d("MainActivity", value + "\n");
}
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
for (textField in results.textResult.fields) {
    val value = results.getTextFieldValueByType(textField.fieldType, textField.lcid)
    Log.d("MainActivity", value + "\n")
}
```

{% endtab %}
{% endtabs %}

### Getting statuses

Getting statuses of [text fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/evisualfieldtype) (one of [`eCheckResult`](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/echeckresult) values):

{% tabs %}
{% tab title="Java" %}

```java
// Get status of FT_SURNAME_AND_GIVEN_NAMES
int surnameAndGivenNames = results.getTextFieldStatusByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES);
// Get status of FT_DATE_OF_BIRTH
int dateOfBirth = results.getTextFieldStatusByType(eVisualFieldType.FT_DATE_OF_BIRTH);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get status of FT_SURNAME_AND_GIVEN_NAMES
val surnameAndGivenNames = results.getTextFieldStatusByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES)
// Get status of FT_DATE_OF_BIRTH
val dateOfBirth = results.getTextFieldStatusByType(eVisualFieldType.FT_DATE_OF_BIRTH)
```

{% endtab %}
{% endtabs %}

Getting statuses of [text fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/evisualfieldtype)*,* [*lcid*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/lcid) (one of [`eCheckResult`](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/echeckresult) values):

{% tabs %}
{% tab title="Java" %}

```java
// Get status of FT_SURNAME_AND_GIVEN_NAMES
int surnameAndGivenNames = results.getTextFieldStatusByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, LCID.BELARUSIAN);
// Get status of FT_DATE_OF_BIRTH
int dateOfBirth = results.getTextFieldStatusByType(eVisualFieldType.FT_DATE_OF_BIRTH, LCID.LATIN);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get status of FT_SURNAME_AND_GIVEN_NAMES
val surnameAndGivenNames = results.getTextFieldStatusByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, LCID.BELARUSIAN)
// Get status of FT_DATE_OF_BIRTH
val dateOfBirth = results.getTextFieldStatusByType(eVisualFieldType.FT_DATE_OF_BIRTH, LCID.LATIN)
```

{% endtab %}
{% endtabs %}

### Getting instances

Getting instances of text fields indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/evisualfieldtype)*:*

{% tabs %}
{% tab title="Java" %}

```java
DocumentReaderTextField textField = results.getTextFieldByType(eVisualFieldType.FT_SURNAME);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
val textField: DocumentReaderTextField = results.getTextFieldByType(eVisualFieldType.FT_SURNAME)
```

{% endtab %}
{% endtabs %}

Getting instances of graphic fields indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/egraphicfieldtype), [*lcid*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/lcid):

{% tabs %}
{% tab title="Java" %}

```java
DocumentReaderTextField textField = results.getTextFieldByType(eVisualFieldType.FT_SURNAME, LCID.BELARUSIAN);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
val textField = results.getTextFieldByType(eVisualFieldType.FT_SURNAME, LCID.BELARUSIAN)
```

{% endtab %}
{% endtabs %}

## Graphic Results

### Getting values

Getting values of [graphic fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#graphic-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/egraphicfieldtype):

{% tabs %}
{% tab title="Java" %}

```java
// Get document image
Bitmap documentImage = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE);
// Get portrait image
Bitmap portrait = results.getGraphicFieldImageByType(eGraphicFieldType.GF_PORTRAIT);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get document image
var documentImage = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE)
// Get portrait image
val portrait = results.getGraphicFieldImageByType(eGraphicFieldType.GF_PORTRAIT)
```

{% endtab %}
{% endtabs %}

Getting values of [graphic fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#graphic-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/egraphicfieldtype)*,* [*source*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_resulttype):

{% tabs %}
{% tab title="Java" %}

```java
// Get document image
Bitmap documentImage = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE);
// Get document image (uncropped)
Bitmap documentImageUncropped = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_UNCROPPED_IMAGE);
// Get portrait image
Bitmap portrait = results.getGraphicFieldImageByType(eGraphicFieldType.GF_PORTRAIT, eRPRM_ResultType.RPRM_RESULT_TYPE_GRAPHICS);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get document image
var documentImage = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE)
// Get document image (uncropped)
var documentImageUncropped = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_UNCROPPED_IMAGE)
// Get portrait image
val portrait = results.getGraphicFieldImageByType(eGraphicFieldType.GF_PORTRAIT, eRPRM_ResultType.RPRM_RESULT_TYPE_GRAPHICS)
```

{% endtab %}
{% endtabs %}

Getting values of [graphic fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#graphic-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/egraphicfieldtype)*,* [*source*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_resulttype)*, pageIndex*:

{% tabs %}
{% tab title="Java" %}

```java
// Get document image from the second page
Bitmap documentImage = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 1);
// Get portrait image from the first page
Bitmap portrait = results.getGraphicFieldImageByType(eGraphicFieldType.GF_PORTRAIT, eRPRM_ResultType.RPRM_RESULT_TYPE_GRAPHICS, 0);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get document image from the second page
var documentImage = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 1)
// Get portrait image from the first page
val portrait = results.getGraphicFieldImageByType(eGraphicFieldType.GF_PORTRAIT, eRPRM_ResultType.RPRM_RESULT_TYPE_GRAPHICS, 0)
```

{% endtab %}
{% endtabs %}

Getting values of [graphic fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#graphic-result) indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/egraphicfieldtype)*,* [*source*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_resulttype)*, pageIndex,* [*light*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_lights):

{% tabs %}
{% tab title="Java" %}

```java
// Get document image from the first page with white light
Bitmap documentImageWhite = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 0, eRPRM_Lights.RPRM_LIGHT_WHITE_FULL);
// Get document image from the first page with UV light
Bitmap documentImageUV = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 0, eRPRM_Lights.RPRM_LIGHT_UV);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get document image from the first page with white light
var documentImageWhite = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 0, eRPRM_Lights.RPRM_LIGHT_WHITE_FULL)
// Get document image from the first page with UV light
var documentImageUV = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 0, eRPRM_Lights.RPRM_LIGHT_UV)
```

{% endtab %}
{% endtabs %}

### Getting statuses

Getting statuses of [graphic fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) indicating [*imageQualityCheckType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/eimagequalitychecktype) (one of [`eCheckResult`](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/echeckresult) values):

{% tabs %}
{% tab title="Java" %}

```java
// Get status of an image's focus
int imageFocus = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_FOCUS);
// Get status of images' glares
int imageGlares = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_GLARES);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get status of an image's focus
val imageFocus = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_FOCUS)
// Get status of images' glares
val imageGlares = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_GLARES)
```

{% endtab %}
{% endtabs %}

Getting statuses of [graphic fields](https://regulaforensics.gitbook.io/android/5.7-5/description-of-results#text-result) indicating [*imageQualityCheckType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/eimagequalitychecktype)*,* [*securityFeature*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_securityfeaturetype) (one of [`eCheckResult`](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/echeckresult) values):

{% tabs %}
{% tab title="Java" %}

```java
// Get status of images' glares
int blank = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_GLARES, eRPRM_SecurityFeatureType.SECURITY_FEATURE_TYPE_BLANK);
int mrz = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_GLARES, eRPRM_SecurityFeatureType.SECURITY_FEATURE_TYPE_MRZ);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
// Get status of images' glares
val blank = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_GLARES, eRPRM_SecurityFeatureType.SECURITY_FEATURE_TYPE_BLANK)
val mrz = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_GLARES, eRPRM_SecurityFeatureType.SECURITY_FEATURE_TYPE_MRZ)
```

{% endtab %}
{% endtabs %}

### Getting instances

Getting instances of graphic fields indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/egraphicfieldtype), [*source*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_resulttype):

{% tabs %}
{% tab title="Java" %}

```java
DocumentReaderGraphicField graphicField = results.getGraphicFieldByType(eGraphicFieldType.GF_SIGNATURE, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
val graphicField: DocumentReaderGraphicField? = results.getGraphicFieldByType(eGraphicFieldType.GF_SIGNATURE, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED)
```

{% endtab %}
{% endtabs %}

Getting instances of text fields indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/egraphicfieldtype), [*source*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_resulttype)*, pageIndex:*

{% tabs %}
{% tab title="Java" %}

```java
DocumentReaderGraphicField graphicField = results.getGraphicFieldByType(eGraphicFieldType.GF_SIGNATURE, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, 0);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
val graphicField: DocumentReaderGraphicField? = results.getGraphicFieldByType(eGraphicFieldType.GF_SIGNATURE, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, 0)
```

{% endtab %}
{% endtabs %}

Getting instances of text fields indicating [*fieldType*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/egraphicfieldtype), [*source*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_resulttype)*, pageIndex,* [*light*](https://regulaforensics.gitbook.io/android/5.7-5/enumerations/erprm_lights)*:*

{% tabs %}
{% tab title="Java" %}

```java
DocumentReaderGraphicField graphicField = results.getGraphicFieldByType(eGraphicFieldType.GF_SIGNATURE, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, 0, eRPRM_Lights.RPRM_LIGHT_WHITE_FULL);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
val graphicField: DocumentReaderGraphicField? = results.getGraphicFieldByType(eGraphicFieldType.GF_SIGNATURE, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, 0, eRPRM_Lights.RPRM_LIGHT_WHITE_FULL)
```

{% endtab %}
{% endtabs %}
