I want to create an app which will have only a service, with totally no UI. No app icon will be shown in app list, just a service will be running in background. Is it possible?
I want to create an app which will have only a service, with totally no UI. No app icon will be shown in app list, just a service will be running in background. Is it possible?
This intent filter tells the OS that this activity is a "starting point". With the AddReplacement call we change the action name to a custom one and therefore prevent the app from appearing in the apps list.
I tried this with an app I wrote. It contains an activity and a service module. The service module is set to start on boot. However, when I install my app, the phone shows the Open button disabled. Only the Done button is enabled. When I reboot my phone, my service does not start on boot. I am confused.
A short explanation about this line. The compiler automatically adds the following intent filter to the main activity:
This intent filter tells the OS that this activity is a "starting point". With the AddReplacement call we change the action name to a custom one and therefore prevent the app from appearing in the apps list.
I am testing on a Samsung Galaxy S4 running Android 4.3. Whenever I install an app, I get a screen saying that the app was installed. It has two buttons, Open (to run the app), or Done (to exit without opening the app). See the attached screen shot.
in the manifest editor, the Open button is disabled, and my service never runs on boot as it is supposed to. However, if I remove that line, and build as a regular app with an icon, the Open button is enabled and I can run my app and the service starts on boot as expected. It seems that if I don't run the activity, then the service never starts on boot.
The Open is disabled because Android doesn't allow the user to start an app with no activities.
The Start At Boot doesn't run for a similar reason. There is a security feature in Android that prevents app from starting after boot if the app was never started before.