Search code examples
androidservicenotificationsbackgroundworker

How do you ship/enable a separate service in android?


Is it possible to launch a service whenever a phone is booted up? My question is that, say, I want to have a background service running in the background when the phone is booted up, once it receives a notification, say, a stock price is now above a certain price, then the user will get notified and in the notification center it will launch the actual app if a user chooses to click on it.

My question is, where do I put the tag? In my application manifest? but again, I only want the service to run automatically without user launching my app.


Solution

  • I see here two possibilities for you:

    1. Is the same approach that was proposed by @triad. You can have a broadcast receiver that will start your service.
    2. You can use push notifications. As I understand from the question it is possible in your case. I guess using push notifications will be cheaper (in the context of power) in your case.