Development Guide (Document Capture)
Document Capture
License Key
The license key is a string
which you need to request from Innov8tif. In the following usage example, we put as LICENSE_KEY
but you can use whatever variable name you want.
Starting camera
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)
OkayCamDoc.start(this, LICENSE_KEY, config) { success, images, exception ->
// do something with the result
}
Configuration
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 = OkayCamConfig.init(this)
config.topLabel.text = "Top Label"
complete list of possible configurations can be found in the following table
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
result callback has 3 params as follow
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
Last updated
Was this helpful?