Android Question How to use built-in barcode reader?

mandu

Member
Licensed User
Longtime User
I have an Android 5.1.1 device for logistic use with the built-in barcode reader.
Is there a library that allows me to use the built-in barcode reader?
 

DonManfred

Expert
Licensed User
Longtime User
They probably provide an SDK, Documentation and Java Example.
Upload them then we can say more.
 
Upvote 0

mandu

Member
Licensed User
Longtime User
Yes, I receive an SDK.
I send help section for 1D barcode reader (pdf).
 

Attachments

  • SDK.zip
    141.7 KB · Views: 132
Upvote 0

mandu

Member
Licensed User
Longtime User
Thanks for your attention,
I need complete sdk because before using module barcode I have to power it and this is a method of sdk.

Unfortunately I am newer with B4A and I do not know how to do a wrapper.

Is there a tool for doing this? Or is there someone who can do this for me (paying the service obviously).

Thanks in advance,
Emanuele
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Is there a tool for doing this?
No

You need to write a wrapper library in java for it. You need javaknowledge to do so.
Or is there someone who can do this for me (paying the service obviously).
You can create a new thread in the Joboffer forum about this.

But at the end you only want to use the barcode? The complete sdk is much more if i remember correctly.

Did you get any errormessage using the code and libray from me?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

mandu

Member
Licensed User
Longtime User
I want only use barcode library: yes it is correct.

I try your code

B4X:
Sub btnReadBarcode_Click
    Dim bc As Barcode1D
   
    lblInfo.Text = lblInfo.Text & " # " & "Click"
   
    bc.initialize("")
   
    If bc.IsInitialized Then
        lblInfo.Text = lblInfo.Text & " # " & "Initialized"
       
        If bc.open Then
            lblInfo.Text = lblInfo.Text & " # " & "Opened"
        Else
            lblInfo.Text = lblInfo.Text & " # " & "NON Opened"
        End If
       
        lblBarcode.Text = bc.scan
   
        If bc.close Then
            lblInfo.Text = lblInfo.Text & " # " & "Closed"
        Else
            lblInfo.Text = lblInfo.Text & " # " & "NON Closed"
        End If
       
        lblInfo.Text = lblInfo.Text & " # " & "The End"
    Else
        lblInfo.Text = lblInfo.Text & " # " & "NOT initialized"
    End If
End Sub

When I click the button "btnReadBarcode", the label "lblInfo" assume only this value "# Click # Initialized" but nothing of the section

B4X:
        If bc.open Then
            lblInfo.Text = lblInfo.Text & " # " & "Opened"
        Else
            lblInfo.Text = lblInfo.Text & " # " & "NON Opened"
        End If

The reader light does not light up.

I try to click the button for the second time, the app closes without message.
 
Upvote 0

mandu

Member
Licensed User
Longtime User
I rename your file "DeviceAPIver20160323.jar" in "DeviceAPI20160323.jar" because this the reference name in "DeviceApi.xml": is it correct?

But nothing of good :-(

This is my new code (Module ID: 1、1D(9600) 2、RFID(115200) 3、UHF(115200) 4、Fingerprint(57600)):

B4X:
Sub btnReadBarcode_Click
    Dim bc As Barcode1D
    Dim api As DeviceAPI
   
    Try
        lblInfo.Text = lblInfo.Text & " # " & "Click"
       
        api.Initialize("")
        bc.initialize("")
       
        If api.IsInitialized And bc.IsInitialized Then
            lblInfo.Text = lblInfo.Text & " # " & "Initialized"
           
            If api.powerOn(1) Then
                lblInfo.Text = lblInfo.Text & " # " & "Powered"
            Else
                lblInfo.Text = lblInfo.Text & " # " & "NOT Powered"
            End If
           
'            If bc.open Then
'                lblInfo.Text = lblInfo.Text & " # " & "Opened"
'            Else
'                lblInfo.Text = lblInfo.Text & " # " & "NOT Opened"
'            End If
'           
'            lblBarcode.Text = bc.scan
'       
'            If bc.close Then
'                lblInfo.Text = lblInfo.Text & " # " & "Closed"
'            Else
'                lblInfo.Text = lblInfo.Text & " # " & "NOT Closed"
'            End If
           
            If api.powerOff(1) Then
                lblInfo.Text = lblInfo.Text & " # " & "Powered off"
            Else
                lblInfo.Text = lblInfo.Text & " # " & "NOT Powered off"
            End If
           
            lblInfo.Text = lblInfo.Text & " # " & "The End"
        Else
            lblInfo.Text = lblInfo.Text & " # " & "NOT initialized"
        End If

    Catch
        Log(LastException)
    End Try
End Sub

The label "lblInfo" displays only "# Click # Initialized";
the second click causes crash.

Somethig with permissions?

In SDK I find this source code:
https://mandustorage06.blob.core.windows.net/mandu-web-site/1D-source.rar
 
Upvote 0

mandu

Member
Licensed User
Longtime User
This is my last request ... can you send me wrapper for the last version of api (module and barcode1D?)?
Thanks in advance
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
https://www.dropbox.com/sh/yss48hn3ecvvbbr/AAArE_88G-lsNHPD4_8eQQmfa?dl=0
New version using the newer sdk, a few new methods in the Module wrapper...
Source available too

As i also added more .so files the lib became much bigger...
But at least you should try. if it works then we can find out which files are not needed....

If it still not work using the init methods. Adapt the source :)
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
This is my last request ... can you send me wrapper for the last version of api (module and barcode1D?)?
Thanks in advance
What device is it that you have? PDAxxxxxx?
 
Upvote 0

mandu

Member
Licensed User
Longtime User
Hi,
thanks for your attention.

My device is "Handheld Terminal SV450-Q4"

I have SDK (from manufacturer).
 

Attachments

  • SV450Q4.jpg
    SV450Q4.jpg
    62.1 KB · Views: 165
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
Hi,
thanks for your attention.

My device is "Handheld Terminal SV450-Q4"

I have SDK (from manufacturer).
OK - just thought that it might be a PDA401 or PDA3506. I managed to get their scanners working via b4a....
 
Upvote 0
Top