#Region Module Attributes
#FullScreen: False
#IncludeTitle: True
#ApplicationLabel: Kiosk App
#VersionCode: 1
#VersionName:
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
'Activity module
Sub Process_Globals
Dim kiosk As Boolean
kiosk = True
End Sub
Sub Globals
Dim btnStop As Button
Dim btnSkype As Button 'I added a button for Skype
Dim mySkype As Skype 'Added
End Sub
Sub Activity_Create(FirstTime As Boolean)
mySkype.Initialize 'Added
btnStop.Initialize("btnStop")
Activity.AddView(btnStop, 10dip, 10dip, 200dip, 200dip)
SetButtonText
btnSkype.Initialize("btnSkype") 'Added
Activity.AddView(btnSkype, 10dip, 200dip, 200dip, 200dip) 'Added
btnSkype.Text = "Door Bell" 'Added
End Sub
Sub Activity_Resume
Log(Activity.GetStartingIntent)
If kiosk = False Then
Dim r As Reflector
r.Target = Activity.GetStartingIntent
If r.RunMethod2("hasCategory", "android.intent.category.HOME", "java.lang.String") Then
Activity.Finish
End If
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If kiosk Then StartServiceAt(KioskService, DateTime.Now + 1 * DateTime.TicksPerSecond, False)
End Sub
Sub btnSkype_Click 'Added call to the Skype test server
mySkype.AddParticipant("echo123")
mySkype.AudioCall(mySkype.ParticipantsList, "Hello There")
End Sub
Sub btnStop_Click
kiosk = Not(kiosk)
If kiosk = False Then
CancelScheduledService(KioskService)
StopService(KioskService)
End If
SetButtonText
End Sub
Sub SetButtonText
If kiosk Then
btnStop.Text = "Stop"
Else
btnStop.Text = "Start"
End If
End Sub