# API Reference

### setActivation

{% code overflow="wrap" %}

```java
public static native int setActivation(String var0);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>setActivation</td></tr><tr><td><strong>Description</strong></td><td>Activate SDK</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>var0</strong> (String): The license string</li></ul></td></tr><tr><td><strong>Output</strong></td><td><p>The SDK activation status code.</p><ul><li>0: Success</li><li>Non-zero: Activation failed</li></ul></td></tr></tbody></table>

### init

{% code overflow="wrap" %}

```java
public static native int init(ContextWrapper var0);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>init</td></tr><tr><td><strong>Description</strong></td><td>Initiate SDK</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>var0</strong> (ContextWrapper ): An instance to access application assets</li></ul></td></tr><tr><td><strong>Output</strong></td><td><p>The SDK initialization status code.</p><ul><li>0: Success</li><li>-1: License Key Error</li><li>-2: License AppID Error</li><li>-3: License Expired</li><li>-4: Activate Error</li><li>-5: Initialize SDK Error</li></ul></td></tr></tbody></table>

### yuv2Bitmap

{% code overflow="wrap" %}

```java
public static native Bitmap yuv2Bitmap(byte[] var0, int var1, int var2, int var3);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>yuv2Bitmap</td></tr><tr><td><strong>Description</strong></td><td>Convert YUV camera frame to Bitmap image</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>var0</strong> (byte[]): Byte array representing the YUV image data in NV21 format</li><li><strong>var1</strong> (int): Width of the image</li><li><strong>var2</strong> (int): Height of the image</li><li><strong>var3</strong> (int): Orientation of the image</li></ul><p>       1 -> No processing<br>       2 -> Flip horizontally<br>       3 -> Flip horizontally first and then flip vertically<br>       4 -> Vertical flip<br>       5 -> Transpose<br>       6 -> Rotate 90° clockwise<br>       7 -> Horizontal and vertical flip --> Transpose<br>       8 -> Rotate 90° counterclockwise</p></td></tr><tr><td><strong>Output</strong></td><td>A Bitmap object representing the converted image</td></tr></tbody></table>

### idcardRecognition

{% code overflow="wrap" %}

```java
public static native String idcardRecognition(Bitmap var0);
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>idcardRecognition</td></tr><tr><td><strong>Description</strong></td><td>Extract data from ID Document</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>var0</strong> (Bitmap): The Bitmap image</li></ul></td></tr><tr><td><strong>Output</strong></td><td>A string representing the extracted data.</td></tr></tbody></table>

#### Output Example for idcardRecognition

<figure><img src="/files/vV1UMJdk4tYgpjsSEkEQ" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```json
{
	"Document Number":"963545627",
	"Nationality":"USA",
	"Date of Issue":"2017-04-14",
	"Document Class Code":"P",
	"Issuing State Code":"USA",
	"Full Name":"JOHN DOE",
	"Date of Birth":"1996-03-15",
	"Sex":"M",
	"Date of Expiry":"2027-04-14",
	"Surname":"JOHN",
	"Given Names":"DOE",
	"Issuing State Name":"United States",
	"Authority":"United States,Department of State",
	"Place of Birth":"CALIFORNIA, U.S.A",
	"Document Name":"Passport",
	"Quality":99,
	"Position": {
		"x1":24,"y1":4294967295,"x2":577,"y2":381
	},
	"MRZ": {
		"Document Number":"963545637",
		"MRZ":"P<USAJOHN<<DOE<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,9635456374USA9603150M2704140202113962<804330",
		"Document Class Code":"P",
		"Issuing State Code":"USA",
		"Full Name":"JOHN DOE",
		"Nationality Code":"USA",
		"Date of Birth":"1996-03-15",
		"Sex":"M",
		"Date of Expiry":"2027-04-14",
		"Surname":"JOHN",
		"Given Names":"DOE",
		"Issuing State Name":"United States",
		"MRZ Type":"ID-3",
		"Validation":1
	},
	"Images":{
		"Portrait":"/9j/4AAQSkZJRgABAQEAxwDH....KUr2P//Z",
		"Document":"/9j/4AAQSkZJRgABAQEAxwDH....o/Dd8yZC"
	}
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.recognito.vision/id-document-recognition-sdk/integration-guide/android/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
