Android Custom Data Field

  • Last Post 04 December 2017
Zloj08 posted this 10 October 2017


Good Morning, Im having slight confusion when trying to create a custom data field for read digits chars. I've read the developers handbook and I still have been able to figure it out. Please in your answer provide an example. 

Please show; 

1.Whats wrong with my code?

2. What wrong with my RegEx?

3. How I can control threads in process scanning my text?


Thank you!


    private boolean createTextCaptureService() {
try {
engine = Engine.load(ScannerActivity.this, licenseFileName);
dataCaptureServic = engine.createDataCaptureService(null, new IDataCaptureService.Callback() {
public void onFrameProcessed(
IDataCaptureService.DataScheme mDataScheme,
IDataCaptureService.DataField[] lines,
IRecognitionService.ResultStabilityStatus resultStatus,
IRecognitionService.Warning warning) {

if (mDataScheme == null) {
surfaceViewWithOverlay.setLines(null, ITextCaptureService.ResultStabilityStatus.NotReady);
if (!stableResultHasBeenReached) {
if (resultStatus.ordinal() >= 3 && lines != null && lines.length > 0) {
surfaceViewWithOverlay.setLines(lines, resultStatus);
} else {
surfaceViewWithOverlay.setLines(null, ITextCaptureService.ResultStabilityStatus.NotReady);
if (resultStatus == ITextCaptureService.ResultStabilityStatus.Stable) {
isMakeInitScanner = true;
stableResultHasBeenReached = true;

public void onRequestLatestFrame(byte[] data) {

public void onError(Exception e) {
IDataCaptureProfileBuilder profileBuilder = dataCaptureServic.configureDataCaptureProfile();

return true;
} catch ( e) {
} catch (Engine.LicenseException e) {
} catch (Throwable e) {
return false;

Diana Khammatova posted this 04 December 2017


Could you please send us additional information in order to investigate your issues deeper?

1. What version of RTR SDK do you use: free or extended? If the second one, then kindly specify your serial number and the build number of RTR SDK. (You can find the build number of RTR SDK in the Readme.html file included in the distribution.)

2. Please describe your issues in more details. (You can attach some screenshots and logs for illustrating the problem.)

a) What error messages do you get?

b) What text strings do you want to recognize? Please send us the set of frames, illustrating the issue.

c) What do you get as a result of recognition?

3. Could you please specify if is it possible to reproduce the issue using standard sample? If this is the case, please send us
your project based on a modified standard sample. If it is not possible to reproduce the issue using our standard sample please send us a minimal project that reproduces your issue and the stepwise instruction of how to launch such project and reproduce the issue.

You can send this information to

As for the third issue, in case of "Capture text from Camera" scenario after a call of the start method of the ITextCaptureService interface several theads will start working. If you would like to pause or stop the application, you can call the ITextCaptureService.stop method to terminate the processing threads. The same methods are used in the "Capture a Custom Data Field" scenario.