integration version
zxing 2.1 inside
no need to install zx scaner or other apk,just a jar and xml file copy it to b4a library dir,and then use it well.
demo:
and you must add last text to manifest editor:
lib doc:
b4aZXing
Author: IceFairy333
Version: 1.5
b4aZXing
Author: IceFairy333
Version: 1.2
anyone who has the scan twice,can download the library src to check it on your device,in my phone it works fine:signOops:
notice by Erel:The second scan happens because zx.BeginScan is called from Activity_Create. The activity is recreated when you change the orientation during the scanning.
The solution is simple. Move this call to a different sub (Button_Click for example).
zxing 2.1 inside
no need to install zx scaner or other apk,just a jar and xml file copy it to b4a library dir,and then use it well.
demo:
B4X:
'Activity module
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 zx As Zxing_B4A
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("Layout1")
zx.BeginScan("myzx")
End Sub
Sub myzx_result(atype As String,Values As String)
Log("type:"&atype&"values:"&Values)
Msgbox("type:"&atype&"values:"&Values,"result")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
B4X:
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>)
lib doc:
b4aZXing
Author: IceFairy333
Version: 1.5
- Zxing_B4A
Events:- result (atype as String As , Values as String As )
- isportrait As Boolean
- useFrontCam As Boolean
- BeginScan (EventName As String)
please handle the event
add this to manifest:<activity android:name="ice.zxing.CaptureActivity"
android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden"></activity>
- android.hardware.camera
- android.hardware.camera.autofocus
- android.permission.CAMERA
- android.permission.FLASHLIGHT
- android.permission.VIBRATE
- android.permission.WRITE_EXTERNAL_STORAGE
b4aZXing
Author: IceFairy333
Version: 1.2
- Zxing_B4A
Events:- result (atype as String As , Values as String As )
- BeginScan (EventName As String)
please handle the event
add this to manifest:<activity android:name="ice.zxing.CaptureActivity"
android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden"></activity>
- android.hardware.camera
- android.hardware.camera.autofocus
- android.permission.CAMERA
- android.permission.FLASHLIGHT
- android.permission.VIBRATE
- android.permission.WRITE_EXTERNAL_STORAGE
anyone who has the scan twice,can download the library src to check it on your device,in my phone it works fine:signOops:
notice by Erel:The second scan happens because zx.BeginScan is called from Activity_Create. The activity is recreated when you change the orientation during the scanning.
The solution is simple. Move this call to a different sub (Button_Click for example).
Attachments
Last edited: