Search code examples
androidservicebroadcastreceiver

Android: running a service with a broadcast receiver.


I have this app that I want to run at phone start up (As in after the GUI comes up) but I want it to run in the background(like a service)

I know this is possible, since most of the android system is like this.

Any tips would be wonderful!


Solution

  • Create a service in your app. Bind it to an Activity if you wish. Subclass BroadcastReceiver to listen to the Android.BOOT_COMPLETED system broadcast. then start your service.