bskotu555 Active Member Nov 7, 2025 #1 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?
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?
J jameshouser New Member Nov 7, 2025 #2 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: Copy 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 Upvote 0
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: Copy 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
teddybear Well-Known Member Licensed User Nov 7, 2025 #3 You can try this example . Or if your phone can install Google services, this is also an option Last edited: Nov 7, 2025 Upvote 0
bskotu555 Active Member Nov 7, 2025 #4 teddybear said: You can try this example . Or if your phone can install Google services, this is also an option Click to expand... I have replaced the camera scanning scheme with a PDA device. I think this part of the code doesn't need to be written anymore. I was lazy, haha Upvote 0
teddybear said: You can try this example . Or if your phone can install Google services, this is also an option Click to expand... I have replaced the camera scanning scheme with a PDA device. I think this part of the code doesn't need to be written anymore. I was lazy, haha
bskotu555 Active Member Nov 7, 2025 #5 teddybear said: You can try this example . Or if your phone can install Google services, this is also an option Click to expand... 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/ Upvote 0
teddybear said: You can try this example . Or if your phone can install Google services, this is also an option Click to expand... 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/