Android Question hello

Jonathan_Mandia

New Member
I have test the barcode reading...however when I test it there an error...

B4A Version: 10.70
Parsing code. (0.09s)
Java Version: 11
Building folders structure. (0.02s)
Compiling code. Error
Error compiling program.
Error description: Array expected.
Error occurred on line: 99
scanner = builder.Initialize("Barcode").BleepEnabled(True).EnableAutoFocus(True).withBackfacingCamera.Text("DonManfred presents").TrackerColor(Colors.Red).build
Word: (


i tried to break the code piece by piece...

builder.Initialize("Barcode")
builder.BleepEnabled(True)
builder.EnableAutoFocus(True)
builder.withBackfacingCamera.Text("Test")
builder.TrackerColor(Colors.Red)

i found out that the error is on this line...

builder.withBackfacingCamera.Text("Test")
builder.TrackerColor(Colors.Red)

i can't find a way on how to solve this error...i really appreciate if someone from the expert here on this community can help me to solve this error...thank you in advance...
 
Hi There and welcome to this awesome forum.

Being a new member you will most definitely get help, provided you follow some simple rules and guidelines such as: (as @agraham states)

Forum Guidelines

New Members: How to Post Questions/Requests for Help

Some General Etiquette

Now, "hello" is not going to attract much attention, but something like "Barcode Reader Error" will.

Using code tags ( </> - top left of the editor ) just makes things look so much neater and easier to read and most likely get a quicker response.

1617696204231.png


Example:
Code: Copy
builder.Initialize("Barcode")
builder.BleepEnabled(True)
builder.EnableAutoFocus(True)
builder.withBackfacingCamera.Text("Test")
builder.TrackerColor(Colors.Red)

and finally - don't worry - we were all "noobs" at something sometime in our lives and since @DonManfred has something to do with this library - he will most likely answer you shortly !!
 
Upvote 0
The problem is in the incompatibility between version 1 and version 1.5 of the library.

The example was created with version 1. In version 1.5 two properties have been changed to read-only:
B4X: Copy
Sub Button1_Click
    Log("Button1 Click event fired")
'    scanner = builder.Initialize("Barcode").BleepEnabled(True).EnableAutoFocus(True).withBackfacingCamera.Text("DonManfred presents").TrackerColor(Colors.Red).build
    builder.Initialize("Barcode")
    builder.BleepEnabled(True)
    builder.EnableAutoFocus(True)
    builder.withBackfacingCamera

'    builder.Text("DonManfred presents") ' 1.50 - read only.
    builder.setText("DonManfred presents") ' use this with v. 1.50

'    builder.TrackerColor(Colors.Red) ' 1.50 - read only.
    builder.setTrackerColor(Colors.Red) ' use this with v. 1.50

    scanner = builder.build
    scanner.startScan
End Sub
 
Last edited:
Upvote 0
scanner = builder.Initialize("Barcode").BleepEnabled(True).EnableAutoFocus(True).withBackfacingCamera.Text("DonManfred presents").TrackerColor(Colors.Red).build
Which library exactly you are using?

If it is the Library from 2016 then i need to admit that i do not have the source anymore and i suggest not to use this library anymore.
 
Upvote 0
Back
Top