Is there a case where clicking a button, invoking the camera, reading a one-dimensional code or a QR code, and then filling the reading result into a text box?
Hello,
Yes, absolutely — that’s a common use case in B4A. You can open the camera, scan a 1D barcode or QR code, and then place the result into a TextField (EditText).
The easiest way is to use the BarcodeScanner library (based on Google ML Kit or ZXing). For example:
B4X:
Sub ButtonScan_Click
Dim scanner As BarcodeScanner
scanner.Initialize("scanner")
scanner.Show 'Opens the camera and scans
End Sub
Sub scanner_BarcodeFound (Barcode As String)
EditText1.Text = Barcode
End Sub
But I have another problem that I can't avoid, which is taking photos and OCR recognizing text into text boxes. I have looked at examples on forums and installed SDK components, but after running, there were no errors or text recognition, which made me quite frustrated:https://www.b4x.com/android/forum/threads/b4x-textrecognition-based-on-mlkit.161210/