'Service module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim fem As Int
fem = 222822402
Dim Obj1 As Reflector
Dim cid As Int
Dim Timer1 As Timer
Timer1.Initialize("Timer1",10000)
End Sub
Sub Service_Create
Timer1.Enabled=True
End Sub
Sub Service_Start
End Sub
Sub Timer1_Tick
Timer1.Enabled=True
Obj1.Target = Obj1.GetContext
Obj1.Target = Obj1.RunMethod2("getSystemService", "phone", "java.lang.String")
Obj1.Target = Obj1.RunMethod("getCellLocation")
cid = Obj1.RunMethod("getCid")
ToastMessageShow("Hello", True)
If cid = fem Then
SetMobileDataEnabled(True)
Else
SetMobileDataEnabled(False)
End If
Timer1.Enabled=True
End Sub
Sub SetMobileDataEnabled(enabled As Boolean)
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "connectivity", "java.lang.String")
r.RunMethod2("setMobileDataEnabled", enabled, "java.lang.boolean")
End Sub
Sub Service_Destroy
End Sub