Android Question How to read Data USB QR Code Reader

Ganiadi

Active Member
Licensed User
Longtime User
Dear All,

I tried to read a barcode through a QRcode reader directly through USB using a Text entry like In windows in notepad
After scanning the barcode, the apps directly closed/teminated.
Is there anything wrong or any other methods to solve this issue, please advice

Tks
 

DonManfred

Expert
Licensed User
Longtime User
please advice
How could we advice? You are not giving enough informations.
Where is the testproject showing the problem?
Where is the full error?
 
Upvote 0

Ganiadi

Active Member
Licensed User
Longtime User
How could we advice? You are not giving enough informations.
Where is the testproject showing the problem?
Where is the full error?
Hi Don,

i just did a simple wedge like keyboard to get barcode reader into a textbox
when i did focus into the textbox and scanned a QR code, it directly closed.
Below is the code that i did :
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals

End Sub

Sub Globals
    Private EditText1 As EditText
    Private Label2 As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)

    Activity.LoadLayout("Layout")
End Sub

Sub EditText1_EnterPressed
    check_barcode
End Sub

Sub check_barcode
    Dim Code As String
    Code = EditText1.Text
    If Code.Length = 13 Then ' EAN13
        Label2.Text = Code
    End If
End Sub

Hope this make it clear.
I dont know is it the correct way to handle the usb reader or is there any other way

Thanks for your help
 
Upvote 0
Top