#Region Project Attributes
#ApplicationLabel: b4aKingsMentor
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#AdditionalRes: ..\DemoRes
#AdditionalRes: ..\LibRes
#AdditionalRes: ..\resource
#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.
Dim rp As RuntimePermissions
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 Button1 As Button
Dim km As KingsMentor
Private Label1 As Label
Private Label2 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")
km.Initialize("junk")
km.BarcodeTextSize = 40.0
km.BarcodeRectangleStrokeWidth = 15.0
Label1.Visible = False
Label2.Visible = False
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
Label1.Visible = False
Label2.Visible = False
Dim Result As Boolean = True
If Not(rp.Check(rp.PERMISSION_CAMERA)) Then
rp.CheckAndRequest(rp.PERMISSION_CAMERA)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
End If
If Result Then
km.BeginScan
End If
End Sub
Sub junk_scan_result(data As Object, closeby As String)
' Log(" ")
' Log("closest code touched = " & closeby)
' Log(" ")
Label1.Visible = True
Label1.Text = "Barcode clicked : " & closeby
Label2.Visible = True
Label2.Text = "Barcodes highlighted when touched:"
Dim finalstring As String = ""
Dim mylist As List = data
For i = 0 To mylist.Size - 1 Step 3
' Log("barcode value : " & mylist.Get(i))
' Log("barcode type : " & mylist.Get(i+1))
' Log("barcode data : " & mylist.Get(i+2))
' Log(" ")
finalstring = finalstring & mylist.Get(i+2) & Chr(10)
Next
Label2.Text = Label2.Text & Chr(10) & Chr(10) & finalstring
End Sub