Ich weiß nicht mehr weiter. Das Programm läuft fehlerfrei im Debug/Release Modus. Doch sobald ich das USB-Kabel entferne, funktioniert es nicht mehr. Mir geht es hier um einen Veranstaltungskalender der statisch an zwei Tagen Benachrichtigungen senden soll. Getestet an einem Samsung S7 Android 8.0.0, B4A 8.80
I do not know how to continue. The program runs error-free in debug / release mode. But as soon as I remove the USB cable, it does not work anymore. This is about a calendar of events that should statically send two days of notifications. Tested on a Samsung S7 Android 8.0.0, B4A 8.80
Code Snip:
Sub Service_Create
Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS
Public PhoneWake As PhoneWakeState
'PhoneWake.KeepAlive(True)
PhoneWake.PartialLock
End Sub
Sub Service_Start (StartingIntent As Intent)
Dim zeit As String
Log("ich habe Samstag gestartet. Ich habe meinen Job gemacht und warte auf die naechste Zeit.")
zeit = DateTime.Time(DateTime.Now)
If zeit = "10:00" Then
Log(zeit)
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.SetInfo("Nächster Event: eins","" , "")
n.Notify(1)
End If
Dim tt As Long = FindNextTime(Array As Double(10, 10.08, 10.18, 10.25, 10.33, 10.42, 10.50, 10.58, 10.67, 10.75, 10.83, 10.92))
Log($"Next Servicetime is: $Time{tt}"$)
StartServiceAt(Me,tt,True)
Service.StopAutomaticForeground
End Sub
I do not know how to continue. The program runs error-free in debug / release mode. But as soon as I remove the USB cable, it does not work anymore. This is about a calendar of events that should statically send two days of notifications. Tested on a Samsung S7 Android 8.0.0, B4A 8.80
Code Snip:
Sub Service_Create
Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS
Public PhoneWake As PhoneWakeState
'PhoneWake.KeepAlive(True)
PhoneWake.PartialLock
End Sub
Sub Service_Start (StartingIntent As Intent)
Dim zeit As String
Log("ich habe Samstag gestartet. Ich habe meinen Job gemacht und warte auf die naechste Zeit.")
zeit = DateTime.Time(DateTime.Now)
If zeit = "10:00" Then
Log(zeit)
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.SetInfo("Nächster Event: eins","" , "")
n.Notify(1)
End If
Dim tt As Long = FindNextTime(Array As Double(10, 10.08, 10.18, 10.25, 10.33, 10.42, 10.50, 10.58, 10.67, 10.75, 10.83, 10.92))
Log($"Next Servicetime is: $Time{tt}"$)
StartServiceAt(Me,tt,True)
Service.StopAutomaticForeground
End Sub