JACK M
JACK M

Reputation: 2851

How to write a background service in Android?

The "service" here is different form one of the application components "service" in Android. I mean that people can not see the app icon in launcher, and, the can not see the app in the program manager in Android. The most important is that I don't want the user notice the existence of the app. Is that possible? Is it a "service" in Linux?

Upvotes: 1

Views: 548

Answers (1)

Justin Breitfeller
Justin Breitfeller

Reputation: 13801

Without ROM modifications, you can't make a linux service. I will tell you what you CAN do.

First, your requirements

  1. Not see the app icon in launcher: This can be done by simply not having an activity that supports the ACTION.MAIN and CATEGORY.LAUNCHER intents.
  2. Not see the app in program manager: Unfortunately for you (but fortunately for all users) you can't get around this with a normal application.
  3. Have a service run "all the time": The best you can do here is start a foreground service upon boot of the device. This will cause a notification to be in the users notification bar, but its really the best you can do on stock phones.

Upvotes: 4

Related Questions