Development Guide (Face Capture)
This page contains the information of Usage, Configuration, Result of OkayCam for Android, iOS and React-native in Face Capture
Usage
Selfie camera can be launched by invoking
start
method on OkaySelfieActivity with context,config and callback method as followConfig 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)
A License Key is required to start the SDK.
OkayCamSelfie.start(this, LICENSE_KEY, config) { success, image, exception ->
// do something with the result
}
Configuration
The configuration object is optional if is calling from Kotlin.
Configuration object can be created and can be customized as follow
If no value is set for properties, default values will be implied
val config = OkaySelfieConfig.init(this)
config.frameColor = Color.YELLOW
List of Possible Configurations
This is a complete list of possible configurations that has been provided to the user to make any custom configuration:
-
width
width to resize the image
null
-
imageQuality
quality of image
1.0f (range from 0 to 1.0)
-
outputPath
desired output image path
null
-
defaultCameraFacing
initial camera facing when the selfie camera is launched
CameraFacing.FRONT
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
-
bottomFrameColor
color of the bottom frame
#EB6709
-
captureBtnColor
color of the capture button
#EB144C
confirmBtnConfig
backgroundColor
background color of the confirm button
#EB144C
confirmBtnConfig
contentColor
content color of the confirm button
#FFFFFF
retakeBtnConfig
backgroundColor
background color of the retake button
#EB144C
retakeBtnConfig
contentColor
content color of the retake button
#FFFFFF
switchBtnConfig
color
color of the switch button
#FFFFFF
switchBtnConfig
show
show or hide the camera switch button
true
Result Callback
After the image is capture or cancelled by the user, the callback method will be called.
Result callback has 3 parameters as follow:
Success
It will be true if the image is captured successfully, else it will return false.
Images
If it is successful, images will contain the file path the image, else it will return null.
Exception
If it is successful, the exception will be null, else it will contain the exception that occurred during the image capturing.
Base64 Conversion
import com.innov8tif.okaycam.utils.BitmapUtils;
String result = BitmapUtils.INSTANCE.convertToBase64(image);
User Interface Example
The OkayCam (face capture) camera user interface follows the design configurations from the above sections.
Example:

Last updated
Was this helpful?