Configure Document Scan SDK for Android
Copy, assets, and font styling can all be customized in the Document Scan for Android SDK. Depending on your needs, you may need to modify resources directly within the provided framework bundle.
Localizable Strings
String keys used within the SDK can be overridden in your application’s strings.xml file.
<resources>
<!--Dynamic Capture Feedback-->
<string name="dynamic_pipeline_error_label.text.out_of_focus">Out of Focus</string>
<string name="dynamic_pipeline_error_label.text.no_document_rectangle">ID not detected</string>
<string name="dynamic_pipeline_error_label.text.too_close">Too Close</string>
<string name="dynamic_pipeline_error_label.text.too_far">Too Far</string>
<string name="dynamic_pipeline_error_label.text.out_of_frame">ID out of frame</ string>
<string name="dynamic_pipeline_error_label.text.not_level">Not Level</string>
<string name="dynamic_pipeline_error_label.text.subject_too_dark">Lighting too low</ string>
<string name="dynamic_pipeline_error_label.text.too_much_glare">Too Much Glare</ string>
<string name="dynamic_pipeline_error_label.text.background_too_dark">Use lighter background</string>
<string name="dynamic_pipeline_error_label.text.background_too_light">Use darker background</string>
<!--Capture Session-->
<string name="invalid.license">License key is expired or invalid!</string>
<string name="camera.permission.required">Camera permission is required to use the capture SDK. Please request camera permission from the user.</string>
<string name="camera.session.could.not.be.initialized">A camera session could not be initialized. Please check camera permissions.</string>
<string name="cancel">Cancel</string>
<string name="document_label">Document Capture Screen</string>
<string name="document_info.label.back">Back</string>
<string name="document_info.label.front">Front</string>
<string name="please.wait">Please Wait...</string>
<string name="tap.screen.to.capture">Tap Screen to Capture</string>
<string name="please.hold.steady">Please Hold Steady</string>
<string name="please.hold.still">Please hold still</string>
<string name="device_limitation_warning">This device lacks auto focus which may impact the capture experience</string>
<!--Review-->
<string name="retake">Retake</string>
<string name="accept">Accept</string>
<string name="review.confirmation">Please check the image and accept if the image is clear</string>
</resources>
Styles and Assets
Font styles and image assets are mapped in a json file. In this file, colors are represented as RGBA, and assets are referenced by relative path name. You can override the default styles and assets by providing your own json file in app > src > main > assets > documentConfiguration.json.
Default Configuration
{
"action_icons": {
"accept_button": {
"background_color": {"R":0,"G":122,"B":255,"A":1.0},
"textSizeLarge": 24,
"textSizeNormal": 16,
"textFont": "fonts/catfishairFont.ttf",
"textColor": {"R":255,"G":255,"B":255,"A":1.0},
"corner_radius": 0
},
"retake_button": {
"background_color": {"R":0,"G":122,"B":255,"A":1.0},
"textSizeLarge": 24,
"textSizeNormal": 16,
"textFont": "fonts/catfishairFont.ttf",
"textColor": {"R":255,"G":255,"B":255,"A":1.0},
"corner_radius": 0
}
},
"brackets": {
"border_color": {"R":255,"G":255,"B":255,"A":1.0}
},
"text": {
"title": {
"textSizeLarge": 32,
"textSizeNormal": 28,
"textFont": "fonts/catfishairFont.ttf",
"textColor":{"R":255,"G":255,"B":255,"A":1.0},
"background_color": {"R":0,"G":0,"B":0,"A":0.0}
},
"tap_to_capture": {
"textSizeLarge": 32,
"textSizeNormal": 28,
"textFont": "fonts/catfishairFont.ttf",
"textColor": {"R":255,"G":255,"B":255,"A":1.0}
},
"cancel_button": {
"textSizeLarge": 24,
"textSizeNormal": 18,
"textFont": "fonts/catfishairFont.ttf",
"textColor": {"R":255,"G":255,"B":255,"A":1.0}
},
"review_text": {
"textSizeLarge": 32,
"textSizeNormal": 16,
"textFont": "fonts/catfishairFont.ttf",
"textColor": {"R":255,"G":255,"B":255,"A":1.0}
}
},
"loader_overlay": {
"gif_image": {
"image_name": "gif/cfaloader.gif"
},
"loader_text": {
"textSizeLarge": 24,
"textSizeNormal": 16,
"textFont": "fonts/catfishairFont.ttf",
"textColor": {"R":255,"G":255,"B":255,"A":1.0}
},
"background_color": {"R":0,"G":0,"B":0,"A":0.0}
}
}