'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim tim As Timer
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 btnStart As Button
'Dim p As Label'Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
btnStart.Initialize("btnStart")
btnStart.Text = "Start Kiosk"
Activity.AddView(btnStart, 10dip, 10dip, 100dip, 100dip)
tim.Initialize("tim", 1000)
End Sub
Private Sub ShowSystemWindow(myText As String)
Dim r As Reflector
r.Target = r.GetContext
Dim cwm As Object = r.RunMethod2("getSystemService", "window", "java.lang.String")
Dim p As Label
p.Initialize("p")
p.Text=myText
Dim lp As Object
Dim i As String = "java.lang.int"
'full screen: lp = r.CreateObject2("android.view.WindowManager$LayoutParams", Array As Object(-1, -1, 2010, 65832, -1), Array As String(i, i, i, i, i))
'small window test lp = r.CreateObject2("android.view.WindowManager$LayoutParams", Array As Object(50, 50, 2006, 65832, -1), Array As String(i, i, i, i, i))
'p.Text = "99%"
lp = r.CreateObject2("android.view.WindowManager$LayoutParams", Array As Object(100, 40, -160, -240, 2010, 65832, -1), Array As String(i, i, i, i, i, i, i))
r.Target = cwm
r.RunMethod4("addView", Array As Object(p, lp), _
Array As String("android.view.View", "android.view.ViewGroup$LayoutParams"))
End Sub
Sub Activity_Resume
'tim.Enabled = False ??
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub tim_Tick
ShowSystemWindow(Rnd(1,100))
End Sub
Sub btnStart_Click
If btnStart.Text="Start Kiosk" Then
btnStart.Text="Stop Kiosk"
tim.Enabled = True
Else
btnStart.Text="Start Kiosk"
tim.Enabled =False
End If
End Sub
Sub p_click
Msgbox("notification click","ok")
End Sub