# Development Guide (Document Capture)

### Document Capture

#### Starting camera <a href="#user-content-starting-camera" id="user-content-starting-camera"></a>

* Camera can be launched by invoking **start** method on OkayCameraActivity with context,config and callback method as follow
* config object is optional if you call from Kotlin (refer to Configuration for more info)
* after the image is captured or the user cancel, the callback method will be called (refer result)

```java
OkayCamDoc.start(this, LICENSE_KEY, config) { success, images, exception ->
    // do something with the result 
}
```

#### Configuration <a href="#user-content-configuration" id="user-content-configuration"></a>

* Configuration object can be created and can be customized as follow
* if no value is set for properties, default values will be implied

```java
val config = OkayCamConfig.init(this)
config.topLabel.text = "Top Label"
```

* complete list of possible configurations can be found in the following table

| -             | Property name   | Description                        | Default value                          |
| ------------- | --------------- | ---------------------------------- | -------------------------------------- |
|               | idType          | document type                      | IdType.ID                              |
|               | crop            | crop the frame area                | false                                  |
|               | width           | width to resize the image          | null                                   |
| topLabel      | text            | text of the top label              | ""(empty string)                       |
| topLabel      | color           | color of the top label             | #FFFFFF                                |
| topLabel      | size            | text size of the top label         | 24                                     |
| bottomLabel   | text            | text of the bottom label           | ""(empty string)                       |
| bottomLabel   | color           | color of the bottom label          | #FFFFFF                                |
| bottomLabel   | size            | text size of the bottom label      | 24                                     |
|               | frameColor      | color of the camera overlay frame  | #FFFFFF                                |
| timer         | backgroundColor | background of the count down timer | #662196F3                              |
|               | captureBtnColor | color of the capture button        | #EB144C                                |
| captureConfig | first           | config for the first capture       | delay:0s,onFlash:false,outputPath:null |
| captureConfig | second          | config for the second capture      | delay:5s,onFlash:true,outputPath:null  |

#### Result <a href="#user-content-result" id="user-content-result"></a>

* result callback has 3 params as follow

| Params    | Possible value                                                                                                          |
| --------- | ----------------------------------------------------------------------------------------------------------------------- |
| success   | will be true if the the image is captured successfully ,otherwise false                                                 |
| images    | if its successful, images will contain file path of 2 images in a list format, otherwise will be null                   |
| exception | if its successful, exception will be null otherwise, it contains the exception that occurred during the image capturing |


---

# 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://api2-ekycapis.innov8tif.com/okaycam-mobile-sdk/okaycam-plus-mobile-sdk/okaycam-plus-android/development-guide-document-capture.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.
