#Region Project Attributes
#ApplicationLabel: EAN - CODE READER
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: landscape
#CanInstallToExternalStorage: True
#End Region
#Region Activity Attributes
#FullScreen: False
#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 Button1 As Button
Dim Button2 As Button
Dim Button3 As Button
Dim Edit1 As EditText
Dim Listview1 As ListView
Private zb1 As ZbarBarcodeScanner
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")
Button1.Initialize("Button1")
Button2.Initialize("Button2")
Button3.Initialize("Button3")
Edit1.Initialize("Edit1")
Listview1.Initialize("Listview1")
Button1.Text = "Start"
Button2.Text = "Set"
Button3.Text = "Ende"
Activity.AddView(Button1, 10dip, 10dip, 60dip, 40dip)
Activity.AddView(Button2, 100dip, 10dip, 60dip, 40dip)
Activity.AddView(Button3, 200dip, 10dip, 60dip, 40dip)
Activity.AddView(Edit1, 10dip, 60dip, 180dip, 40dip)
Activity.AddView(Listview1, 10dip, 120dip, 240dip, 150dip)
zb1.Initialize("scan_result")
zb1.LaserColor = Colors.Yellow
zb1.MaskColor = Colors.ARGB(150, 0, 0, 200)
zb1.BorderColor = Colors.Magenta
zb1.BorderLineLength = 40
zb1.BorderStrokeWidth = 5
zb1.Visible = False
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
zb1.stopScanner
zb1.Visible = False
End Sub
Sub Button1_Click
zb1.Visible = True
zb1.startScanner
End Sub
Sub Button2_Click
zb1.Visible = False
zb1.stopScanner
End Sub
Sub Button3_Click
Activity.Finish
End Sub
Sub zb1_scan_result(scantext As String, scanformat As String)
Listview1.AddTwoLines(scantext, Edit1.Text & " Artikelname")
' in die 1. Zeile soll dann die separierte Artikelnr.
' in die 2.Zeile soll später noch der Artikelname und evtl. Stückzahl
End Sub