I have an application with widget that monitors battery voltage. The old version has a widget with run at boot setting and it works. It was maded with on old version of B4Android. Now i made minor modification and i build it with B4Android 7.3 and it not run automatically at boot. Now it has a starter module. I set run at boot setting to false and to true in starter module, but nothing helps. Not running at boot. Widget module is the same. I use this attributes in widget service:
B4X:
#Region Service Attributes
#StartAtBoot: True
#StartCommandReturnValue: android.app.Service.START_STICKY
#End Region
Application is tested on android 7.1.1
Why is that?
The Starter service is identified by its name. You can add a new service named Starter to an existing project and it will be the program entry point.
This is an optional feature. You can remove the Starter service.
You can call StopService(Me) in Service_Start if you don't want the service to keep on running. However this means that the service will not be able to handle events (for example you will not be able to use the asynchronous SQL methods).
The starter service should be excluded from compiled libraries. Its #ExcludeFromLibrary attribute is set to True by default.
The starter service should never be explicitly started. This means that if you want to start a service at boot then add a different service.
Do you mean to delete the starter service? I set starter attributes run at boot to false and widget service run at boot to true. But is not working. Not run at boot. Maybe is needed some setting in manifest editor for android 7 to run in background and run at boot?
I set B4A to work with android 25 and now is starting at boot. I tested on my android 7 tablet. Also i think my phone don't let automatically an application to start at boot.
Something else bothers me now. When application service start at boot, a message in status bar appear and say that application started and you can view other information about application. But i can not delete this message. If i start the application than message disappear automatically. Why is that?
After a phone boot i get this message and i can't delete it. If i start application once, the message is gone. My app with widget is Battery monitoring 3.
No. There is no need to start the widget service manually.....
IF it is placed on the desktop then it will be launched automatically by the launcher-app
If the widget is not on the desktop then the service will not start