B4A Library MaterialBarcodeScanner (Uses Google Mobile Vision API)

This is a wrap for this github project.

Easy to use barcode reader for your Android Project (Uses Google Mobile Vision API)
  • Integrate in a few minutes
  • Quick and simple api
  • No external apps required
  • Uses Google Mobile Vision API (fast scanning, local)
  • Automatically parses QR Codes, Data Matrix, PDF-417, and Aztec values
  • Supports 1D barcodes: EAN-13, EAN-8, UPC-A, UPC-E, Code-39, Code-93, Code-128, ITF, Codabar
  • Supports 2D barcodes: QR Code, Data Matrix, PDF-417, Aztec

MaterialBarcodeScanner
Author:
DonManfred (wrapper)
Version: 1
  • BarcodeScanner
    Methods:
    • Initialize (EventName As String)
    • IsInitialized As Boolean
    • startScan
      Start a scan for a barcode

      This opens a new activity with the parameters provided by the MaterialBarcodeScannerBuilder
  • BarcodeScannerBuilder
    Events:
    • onResult (barcode As String)
    Methods:
    • BleepEnabled (enabled As Boolean) As MaterialBarcodeScannerBuilderWrapper
      Enables or disables a bleep sound whenever a barcode is scanned
    • CameraFacing (cameraFacing As Int) As MaterialBarcodeScannerBuilderWrapper
      Either CameraSource.CAMERA_FACING_FRONT or CameraSource.CAMERA_FACING_BACK
      cameraFacing:
    • EnableAutoFocus (enabled As Boolean) As MaterialBarcodeScannerBuilderWrapper
      Enables or disables auto focusing on the camera
    • FlashLightEnabledByDefault As MaterialBarcodeScannerBuilderWrapper
      Shows a text message at the top of the barcode scanner
    • Initialize (EventName As String) As MaterialBarcodeScannerBuilderWrapper
    • IsInitialized As Boolean
    • Text (text As String) As MaterialBarcodeScannerBuilderWrapper
      Shows a text message at the top of the barcode scanner
    • TrackerColor (color As Int) As MaterialBarcodeScannerBuilderWrapper
      Sets the tracker color used by the barcode scanner, By default this is Material Red 500 (#F44336).
      color:
    • build As MaterialBarcodeScanner
      Build a ready to use MaterialBarcodeScanner
      Return type: @return:A ready to use MaterialBarcodeScanner
    • withBackfacingCamera As MaterialBarcodeScannerBuilderWrapper
      Makes the barcode scanner use the camera facing back
    • withFrontfacingCamera As MaterialBarcodeScannerBuilderWrapper
      Makes the barcode scanner use camera facing front

ATTENTION:
- You need to have google-play-services.jar in your additional libs folder
- You need to have android-support-v4.jar in your additional libs folder
- You need to have android-support-v7-appcompat..jar in your additional ibs folder. Especially the app must be prepared to use AppCompat. So follow the apcmpat tutorial.

I´ve used Example1 of the AppCompat-Tutorials and used the Button in the layout to trigger a Barcodescan

See it in action
 

Attachments

  • MaterialBarcodeEx.zip
    34.6 KB · Views: 933
  • MaterialBarcodelibfiles1.0.0.zip
    84.1 KB · Views: 879
  • MaterialBarcodeScannerV1.5.zip
    88.2 KB · Views: 739
Last edited:

DonManfred

Expert
Licensed User
Longtime User
I just saw i did not released 1.5 as yet....

I´ve uploaded V1.5 to post #1

Try again with this version please.
 

DonManfred

Expert
Licensed User
Longtime User
The error "AppCompat1 program stopped"
Without posting the complete stacktrace you just can "not post anything".
It will not help without the stacktrace, errorlog.

I cannot help either with this less information.
I could find more interesting things to do in my holiday than to help here
 

FrankDev

Active Member
Licensed User
Longtime User
I can start the barcodescanner
'Start scan'
But
How can I terminate it programmatically?


ich kann den Barcodescanner zwar starten
'startScan'
Aber
wie kann ich ihn Programmgesteuert beenden ?

Gruß Frank
 

jimmyF

Active Member
Licensed User
Longtime User
I have set it up as instructed but cannot compile due to this error:
"Array expected" on Line 99
B4X:
97 Sub Button1_Click
98    Log("Button1 Click event fired")
99    scanner = builder.Initialize("Barcode").BleepEnabled(True).EnableAutoFocus(True).withBackfacingCamera.Text("DonManfred presents").TrackerColor(Colors.Red).build
100    scanner.startScan
101 End Sub

Using B4A 7.01
 

FrankDev

Active Member
Licensed User
Longtime User
a pity

I thought with the result of
'Builder.Activity'
I have some way to close the window.



schade

ich dachte mit dem Ergebnis von
'builder.Activity'
habe ich irgend eine Möglichkeit das Fenster zu beenden.
 

DonManfred

Expert
Licensed User
Longtime User
You dont need to write german for me. I can read the english part with no problem ;-)
If you are not able to describe it clearly then you can use german as a sencond language for sure

Wenn Du es nicht deutlich ausdrücken kannst in english, dann kannst Du es natürlich gerne in Deutsch schreiben (zusätzlich; wir sind ja hier im englischen Bereich des Forums)
 

FrankDev

Active Member
Licensed User
Longtime User
I do not see the problem on your side;)

Unfortunately I'm not so confident the google translate translated everything as desired.


Ich sehe das Problem auch nicht auf deiner Seite ;)

leider bin nicht so überzeugt das google translate alles wie gewünscht übersetzt.

'zusätzlich' - genau so habe ich es gemacht.
 

DonManfred

Expert
Licensed User
Longtime User
leider bin nicht so überzeugt das google translate alles wie gewünscht übersetzt.
"Sie sind der Meinung das war (hüpf)SPITZEEEE" trifft es nicht ganz, yo :D (keine Ahnung wie alt/jung Du bist)

Well done is the wrong term for googles translate ;)
 
Top