# Development Guide (Face Capture)

### Face Capture <a href="#user-content-usage---face-capture" id="user-content-usage---face-capture"></a>

#### Starting camera

* Selfie camera can be launched by invoking **start** method on OkaySelfieActivity 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
OkayCamSelfie.start(this, LICENSE_KEY, config) { success, image, exception ->
    // do something with the result 
}
```

#### Configuration <a href="#user-content-configuration-1" id="user-content-configuration-1"></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 = OkaySelfieConfig.init(this)
config.frameColor = Color.YELLOW
```

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

| -                        | Property name       | Description                                           | Default value                           |
| ------------------------ | ------------------- | ----------------------------------------------------- | --------------------------------------- |
|                          | width               | width to resize the image                             | null                                    |
| topLabel                 | text                | text of the top label                                 | Please align your face within the frame |
| topLabel                 | color               | color of the top label                                | #FFFFFF                                 |
| topLabel                 | size                | text size of the top label                            | 24                                      |
| -                        | frameColor          | color of the selfie overlay frame                     | #000000                                 |
| -                        | bottomFrameColor    | color of the bottom frame                             | #EB6709                                 |
| okaySelfieSwichBtnConfig | color               | color of the switch button                            | #FFFFFF                                 |
| okaySelfieSwichBtnConfig | show                | show or hide the camera switch button                 | true                                    |
| -                        | defaultCameraFacing | initial camera facing when the selfie cam is launched | CameraFacing.FRONT                      |

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

* Result callback has 3 params as follow

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

***

### Face Plus Capture

#### Starting camera

* Selfie camera can be launched by invoking **start** method on OkaySelfiePlus with context, license and callback method as follow
* After the image is captured or the user cancel, the callback method will be called (refer result)

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

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

* Result callback has 3 params as follow

| Params    | Possible value                                                                                                                      |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| success   | will be true if the the image is captured successfully, otherwise false                                                             |
| result    | if it's successful, result will contain json string, otherwise will be null. `{ selfie: selfie_image_path, bundle: base64String }`. |
| exception | if it's not successful, it contains the exception that occurred during the image capturing, otherwise, exception will be null.      |


---

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