Sub Service_Start (StartingIntent As Intent)
GetLocks
Service.StartForeground(nid, Create_Notification(Common.AppName, Common.AppVer))
End Sub
Private Sub GetLocks
LogColor("Getting Locks", Colors.Green)
Try
Dim r As Reflector
r.Target = wifilock
r.RunMethod("acquire")
Catch
LogColor("Aquire WiFiLock Failed!", Colors.Red)
End Try
Try
Awake.PartialLock
Catch
LogColor("Aquire PartialLock Failed!", Colors.Red)
End Try
End Sub
Private Sub Create_Notification(L1 As String, L2 As String) As Notification
Dim BM As Bitmap = LoadBitmap(File.DirAssets, "icon_sm.png")
Dim Target As Object
If Main.Tablet Then
Target=GUI_T
Else
Target=GUI
End If
Dim n As NB6
n.Initialize("default", Common.AppName, "LOW").AutoCancel(False).SmallIcon(BM)
n.SetDefaults(False, False, False) ' Turn off sound, light, and vibrate
Dim Noti As Notification = n.Build(L1, L2, "tag1", Target)
Return Noti
End Sub