B4A Library ZXingLib(integration version)by icefairy333

Sergio Haurat

Active Member
Licensed User
Longtime User
My English = Google translator, sorry
It is possible that the rectangle where the scan is done, it will expand more?
 

Sergio Haurat

Active Member
Licensed User
Longtime User
In Manifest file try:
AddApplicationText(<activity android:name="ice.zxing.CaptureActivity"
android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden"></activity>)
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Thanks but the screen is still landscape. I mean the viewfinder or whatever its name is .
I have to turn phone to landscape so I can scan codes
 

joneden

Active Member
Licensed User
Longtime User
Hi All,

Attached is my tweak to this lib, it was written for my use cutting out parts that I didn't need so it may work for you and it may not. This one allow portrait use, full screen scanning, timeout after x seconds etc. Oh and you can select front or back cameras so it works on the Nexus.

It's unsupported and included to bail you out if you have no other option. Icefairy I can supply you with the altered source code if you want it although it's ages since I worked on this.

Hope it helps someone!

Cheers

Jon
 

Attachments

  • b4aZXing 1.2.zip
    250.8 KB · Views: 440

joneden

Active Member
Licensed User
Longtime User
Sorry to hear that - not sure if it would work on that ver. Manifest text is below

B4X:
AddApplicationText(<activity android:name="ice.zxing.CaptureActivity"
            android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:windowSoftInputMode="stateAlwaysHidden">
        </activity>)

and the code for calling it as below - I think that the cancelled event is extra to the original but that shouldn't cause the black screen:
B4X:
' Event handler for button presses, passed variable include the in/out status
Sub DoEvent(intEventTypeNo As Int)
    ' Start scanning for barcodes
    objB4AZXing.useFrontCam = True
    objB4AZXing.isportrait=True
    objB4AZXing.endAt=DateTime.Now + (Common.SecondsToScanForBarcode * 1000)
    objB4AZXing.BeginScan("objbarcodescanning")
End Sub

' Event handler for barcodes being found
Sub objbarcodescanning_barcodefound(strFormatName As String,strBarCode As String)

End Sub

' Procedure to stop the barcode scanner
Sub objbarcodescanning_cancelled(timeout As Boolean)

End Sub
 

LucaMs

Expert
Licensed User
Longtime User
I was wrong.

I had forgotten to change the Manifest File.

It works great!

We should erect a monument dedicated to you!

Thank you very much, great job, Jon

(endAt is the maximum time that is allowed to perform the scan?)
 
Last edited:

joneden

Active Member
Licensed User
Longtime User
Good to hear that it works

Yes, I have it for a Time and Attendance app amongst others and needed a way to have a time out on it so that did the trick. Watch out with the sub naming as I found that case plays an important part on them.

Enjoy
 

eduardo74

Member
Licensed User
Longtime User
I have problem with Galaxy Tab 3 7", no autofocus... any idea
Galaxy S3 and Galaxy S4 working very good
 

jruiz1998

Member
Licensed User
Longtime User
Jon,
Very good.

Just one question,
It does not recognize "Common". It says "Undeclared Variable..."

Thanks
JRuiz
 

dibb3386

Member
Licensed User
Longtime User
Hi, Ive got the camera running on a panel and this running on a transparent panel ontop of this, however I get an error java.lang.ClassCastException: anywheresoftware.b4a.BALayout cannot be cast to android.view.SurfaceView.

Why has this happened? Can i not use zxinglib in my own panel? Idea was to have the camera running and the zxinglib to scan so you can see what you scanning, looking in to a qr code scanner built in to my app.
Any help would be great
Thanks
 

AHilton

Active Member
Licensed User
Longtime User
Has anyone tried the Moto G with this library? Not all phones and tablets have the capability to autofocus close enough for good barcode reading or don't have a macro setting. From what I've read, the Moto G has some strange focusing but I haven't gotten my hands on one yet to test.
 

petronas

New Member
Licensed User
Longtime User
Hi Joneden,

May I request for the demo project using your tweaked ABZxing lib?

THanks
Petronas
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…