Android Question App dosen't work without USB-Cable


Licensed User
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
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
Dim n As Notification
n.Icon = "icon"
n.SetInfo("Nächster Event: eins","" , "")
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}"$)

End Sub


Licensed User
You need to compile the program in Release mode to make it independant.

Upvote 0


Licensed User
OK, this should be an information app for a local Harley event. The user should be informed, when the next band is on the stage. And for this, a notification will be popup. In my test every 5 minutes. You can also tip on a row and a picture comes in front and you can resize it.
With hyperlinks to several pages. Everything work fine, when a cable is pluged and so in charging mode, no matter if the display is on or not. But when I install the app and unplug the cable, only the first notification on the next timetable pops up and that's it. No error, nothing. You can view the pictures click on the lnks, everything works, but no notification.

In my eample, I remove the pictures, because it's too big.


    32.3 KB · Views: 60
Upvote 0


Licensed User
Now it works! I think the most reason for this is the line:
that will bring the message in front.

Thanks a lot!!
Upvote 0