> For the complete documentation index, see [llms.txt](https://api2-ekycapis.innov8tif.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api2-ekycapis.innov8tif.com/okaycam-mobile-sdk/okaycam-plus-mobile-sdk/okaycam-plus-android/development-guide-document-capture.md).

# 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 |
