#Region Project Attributes
#ApplicationLabel: zxScannerLiveView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: landscape
#CanInstallToExternalStorage: False
#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.
Private zxslv As zxScannerLiveView
Private b1 As Button
Private b2 As Button
Private l1 As Label
Private l2, l3, l4, l5 As Label
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("main")
zxslv.Initialize("zxslv")
Dim framecolor As Int = Colors.Red
l2.Initialize("")
l3.Initialize("")
l4.Initialize("")
l5.Initialize("")
Activity.AddView(zxslv, 50%x - 45%y, 5%y, 90%y, 90%y)
Activity.AddView(l2, 50%x - 45%y - 1%y, 4%y, 1%y, 92%y)
Activity.AddView(l3, 50%x + 45%y, 4%y, 1%y, 92%y)
Activity.AddView(l4, 50%x - 45%y - 1%y, 4%y, 91%y, 1%y)
Activity.AddView(l5, 50%x - 45%y - 1%y, 5%y + 90%y, 91%y, 1%y)
l2.Color = framecolor
l2.Visible = False
l3.Color = framecolor
l3.Visible = False
l4.Color = framecolor
l4.Visible = False
l5.Color = framecolor
l5.Visible = False
zxslv.HudVisible = True
zxslv.PlaySound = True
zxslv.Visible = False
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
zxslv.Visible = False
zxslv.stopScanner
l2.Visible = False
l3.Visible = False
l4.Visible = False
l5.Visible = False
End Sub
Sub b1_Click
zxslv.Visible = True
zxslv.startScanner
l2.Visible = True
l3.Visible = True
l4.Visible = True
l5.Visible = True
End Sub
Sub b2_Click
zxslv.Visible = False
zxslv.stopScanner
l1.Text = ""
l2.Visible = False
l3.Visible = False
l4.Visible = False
l5.Visible = False
End Sub
Sub zxslv_scanresult
Log(zxslv.ScanResult)
l1.Text = zxslv.ScanResult
End Sub
Sub zxslv_scanner_started
Log("Scanner Started")
End Sub
Sub zxslv_scan_error
Log("Scan Error")
End Sub
Sub zxslv_scanner_stopped
Log("Scanner stopped")
End Sub