Try with this (B4A project attached):
Copy the jar and xml to your additional libs folder
Extract folder
resource and
OCRCompleteRes from the attached zip files and copy the folder (with their contents) to be on the same folder level as the /Files folder of the B4A project.
Click on a highlighted box (once the scanner is active) to return the text (text returned will be displayed in the label below button
Start Scan)
Remember to do:
Tools -> Jetifier
Tools -> Clean project
....then compile B4A project
#Region Project Attributes
#ApplicationLabel: b4aOCRComplete
#VersionCode: 1
#VersionName:
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#MultiDex: True
#End Region
#AdditionalRes: ..\resource
#AdditionalRes: ..\OCRCompleteRes
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private Button1 As Button
Dim avocr As OCRReaderComplete
Private CheckBox1 As CheckBox
Private CheckBox2 As CheckBox
Private Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
avocr.Initialize("avocr")
avocr.OCRtextColor = Colors.Red
avocr.OCRtextSize = 35.0
avocr.OCRrectangleColor = Colors.Green
avocr.OCRrectangleWidth = 2.0
avocr.TTSActive = False
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
If CheckBox1.Checked = True Then
avocr.UseFlash = True
Else
avocr.UseFlash = False
End If
If CheckBox2.Checked = True Then
avocr.UseAutoFocus = True
Else
avocr.UseAutoFocus = False
End If
avocr.StartOCRReader
End Sub
Sub avocr_selected_text_result(result As String)
Label1.Text = ""
Label1.Text = result
End Sub