Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim vibrate As PhoneVibrate
Dim phonesensor As PhoneSensors
Dim notification1 As Notification
Dim toggle1 As Toggle
End Sub
Sub Service_Create
phonesensor.Initialize(phonesensor.TYPE_PROXIMITY)
notification1.Initialize
toggle1.Initialize()
End Sub
Sub Service_Start (StartingIntent As Intent)
notification1.OnGoingEvent = True
notification1.Sound = False
notification1.vibrate = False
notification1.Icon = "icon"
notification1.SetInfo("App is running" , "tap to stop app" , Main)
notification1.Notify(1)
phonesensor.StartListening("phonesensor")
End Sub
Sub phonesensor_SensorChanged (Values() As Float)
Service.StartForeground(1 , notification1)
If Values(0) = 0 Then
toggle1.ToggleWiFi
vibrate.vibrate(200)
End If
End Sub
Sub Service_Destroy
End Sub