B4A Library Barcode Scanner - Wrapper for Manatee Works SDK

I have created a wrapper for the ManateeWorks SDK. You can download the APK from here:

https://www.dropbox.com/s/mp3wqayepuxj9e2/manteeb4awrapper.apk?dl=0

I have registered for evaluation purposes that are valid until 17 July 2017. My licence key has been hardcoded in the library.

This is the only barcode scanner that I have come across thus far that can read DotCode type 2D barcodes.

Other than being able to read DotCode barcodes it will also read other 2D barcodes including Maxicode, PDF417, Aztec codes, Datamatix, QRcodes, etc. and of course it also reads 1D barcodes.

Not sure if it will work for you (due to the registration...?) but I have tested it on 2 different devices and it seems to be working.

I have in my B4A code allowed for continuous scanning (not included in the APK) or for single scanning.

Please test and let me know if it is working on your device(s)

The DotCode below contains the following message:
Hello B4A. This is an example of a 2D DotCode type barcode

Visit this page to test the various barcode types (1D and 2D) that it will be able to read. It will even read ISBN 13 + 5 and ISSN +2 (and a lot more...)

Library:
ManteeWorks
Author:
Johan
Version: 1
  • ManteeWorks1
    Events:
    • result (atype as String , Value as String)
    Methods:
    • BeginScan (EventName As String)
    Permissions:
    • android.hardware.camera
    • android.permission.ACCESS_FINE_LOCATION
    • android.permission.CAMERA
    • android.permission.INTERNET
    • android.permission.READ_EXTERNAL_STORAGE
    Properties:
    • ContinuousScanning As Boolean [write only]
    • Key As String [write only]








barcode (1).gif
 
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User

Johan Schoeman

Expert
Licensed User
Longtime User
They are not cheap. See Pricing.
Can you download and test the APK and see if it works? I have tested it on Lollipop and Marshmallow and working on both. Also on Kitkat.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Here is the B4A project and the B4A lib files:
1. Download the B4A lib files from here https://www.dropbox.com/s/tp3gz0rwk8nmsdy/ManteeWorksLibFiles.zip?dl=0 and copy them to your additional library folder.
2. Attached the following:
a. The B4A project
b. resource.zip - extract the folder "resource" and copy it (with its contents) to be on the same folder level as that of the /Objects and /Files of the B4A project
c. DemoRes.zip - extract the folder "DemoRes" and copy it (with its contents) to be on the same folder level as that of the /Objects and /Files of the B4A project
Sample Code:
B4X:
#Region  Project Attributes
    #ApplicationLabel: manteeb4awrapper
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: landscape
    #CanInstallToExternalStorage: False
#End Region

#AdditionalRes: ..\DemoRes
#AdditionalRes: ..\resource

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

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
  
    Dim mtw As ManteeWorks1

    Private Button1 As Button
    Private Label1 As Label
    Private Label2 As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")
    mtw.ContinuousScanning = True
    mtw.Key = "pphvYZN6pbwFFeNVtW5nz2OCl9xhfw4fc+bjzaSsv0A="               'This key is only valid until 17 July. Register your own key
                                                                           'to keep on testing or purchase the permanent licence whereby
                                                                            'you will be issued with a permanent key. Register here "https://manateeworks.com/"

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub Button1_Click
  
    mtw.BeginScan("scanresult")
  
End Sub

Sub scanresult_result(atype As String, value As String)
  
    'you will have to handle consecutive scans results when setting mtw.ContinuousScanning = True
  
    Log("in B4A and atype = " & atype)
    Log("in B4A and value = " & value)
  
    Label1.text = "Type: " & atype
    Label2.Text = "Value: " & value
  
  
  
End Sub

B4A Manifest:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
SetApplicationAttribute(android:theme, "@style/MyAppTheme")  

AddApplicationText(<activity
            android:name="com.manateeworks.camerademo.ActivityCapture"
            android:configChanges="orientation|keyboardHidden"
            android:screenOrientation="landscape"
            android:theme="@style/AppTheme.FullScreen"/>)


Please note that you will have to leave the package name (Tools ----> Build Configurations) as is to test this app as it has been registered as such.

upload_2017-6-17_15-44-43.png





 

Attachments

  • resource.zip
    423 bytes · Views: 241
  • ba4manateeworks.zip
    8.7 KB · Views: 228
  • DemoRes.zip
    79.3 KB · Views: 232
Hello Johan,

I tried to compile this example in some devices like Moto G8 Power and Samsung A70 but I got an error when I click in the button "begin scan":

1611576876888.png


I tried to contact the Manatee team to buy licenses but they dont have a library for B4A, I´m in contact with manatee team to convince the poweful of b4x tools, but for now if posible please help me to compile this example.

PS: I tested you APK and works fine!

tks,

Leandro
 
Hello Johan,

I tried to compile this example in some devices like Moto G8 Power and Samsung A70 but I got an error when I click in the button "begin scan":

View attachment 106898

I tried to contact the Manatee team to buy licenses but they dont have a library for B4A, I´m in contact with manatee team to convince the poweful of b4x tools, but for now if posible please help me to compile this example.

PS: I tested you APK and works fine!

tks,

Leandro


Hello Johan,

Sorry for the inconvenience, I was able to compile the project and now is working like a charm!

It seems was missing to click in: Tools--> jetifier

tks
 
Hello Johan,

In the ContinuousScanning = true is not triggering the sub "scanresult_result" for each read. The sub "scanresult_result" just is called one time when the user press the key to close the scan mode (KEYCODE_BACK).

I can see in the log the barcode reads (below), but I can´t get the result value.

1617226343084.png


Is there a chance to share the wrapper code, I would like try to do some changes like open the scan mode with the "light flash" = on

tks,

Leandro
 

Xfood

Expert
Licensed User
I suggest you use this one, I find it excellent except for the vertical mode which does not fit well, as you can see in the last post, if you can adapt it it would be very useful.
 
I suggest you use this one, I find it excellent except for the vertical mode which does not fit well, as you can see in the last post, if you can adapt it it would be very useful.

Thanks for the suggestion! I know zxing and I tried others libs like kingsmentor, google play services, etc
I did hard and massive tests, for me this library is the best, unfortunately is paid.
 

LucaMs

Expert
Licensed User
Longtime User
I suggest you use this one, I find it excellent except for the vertical mode which does not fit well, as you can see in the last post, if you can adapt it it would be very useful.
https://www.b4x.com/android/forum/threads/b4x-b4xpages-barcode-reader.120417/#content
 

Xfood

Expert
Licensed User
Thanks for the suggestion! I know zxing and I tried others libs like kingsmentor, google play services, etc
I did hard and massive tests, for me this library is the best, unfortunately is paid.
no, it is complete with the source, if you look carefully at the post I gave you
 
no, it is complete with the source, if you look carefully at the post I gave you

Sorry I´m not so clear, I really know "zxing lib" I tested more than 10 libs for barcode reader in more than 200 devices. This lib wrapper for Johan (manatee works) is the best. I don´t want try another lib. tks
 

Johan Schoeman

Expert
Licensed User
Longtime User
Sorry I´m not so clear, I really know "zxing lib" I tested more than 10 libs for barcode reader in more than 200 devices. This lib wrapper for Johan (manatee works) is the best. I don´t want try another lib. tks
I will upload the Java source code
 

Johan Schoeman

Expert
Licensed User
Longtime User
Sorry I´m not so clear, I really know "zxing lib" I tested more than 10 libs for barcode reader in more than 200 devices. This lib wrapper for Johan (manatee works) is the best. I don´t want try another lib. tks

Download it from here.....
 

Johan Schoeman

Expert
Licensed User
Longtime User
hello @Johan Schoeman , need a key to make this lib work?

mtw.Key = "pphvYZN6pbwFFeNVtW5nz2OCl9xhfw4fc+bjzaSsv0A="
Yes. You need to register for a trial period of 30 days too get a key
 
Top