2

I am making an Android app which is supposed to monitor the other running apps.

The question is, how do I make my app run continuously from when i first activate it. It should also start running by itself when I switch off and reboot the phone.

Any suggestions on how to ensure this? I am considering using a background thread but I am not convinced this alone will suffice.

SoulRayder
  • 5,072
  • 6
  • 47
  • 93

4 Answers4

1

Well you should try to have an Service into your app that could keep track of the other App's running

So Every Time the App start's the Service Would Start And Accordingly give The Updated to your app regarding the Other App Working

For Boot Time Start you Should Try System BroadCast Receiver

You should Really Follow this Tutorial

Nitesh Tiwari
  • 4,742
  • 3
  • 28
  • 46
1

Create a service to monitor apps in the background.

http://developer.android.com/guide/components/services.html

To make the app load at boot:

Create a BroadcastReceiver and register it to receive ACTION_BOOT_COMPLETED. You also need RECEIVE_BOOT_COMPLETED permission.

Refer to this:

Android -Starting Service at Boot Time

Community
  • 1
  • 1
Aniket Kapse
  • 315
  • 3
  • 20
1

You have to use a Service. But keep in mind that your service can be killed and restarted after a while. And you should register a broadcast receiver to listen for ACTION_BOOT_COMPLETED so that you can start the service once the phone booted successfully.

suitianshi
  • 3,300
  • 1
  • 17
  • 34