 <p>Android reserves the right to kill any application or component that isn't visible to the user (even those can be killed, but it's a rare occurrence). Most often, this is due to memory pressure, and the system kills applications to free up resources.</p> <p>If you have a long-running process that runs in the background and it should run continuously, your best bet is to make it a <a href="http://developer.android.com/reference/android/app/Service.html#startForeground%28int,%20android.app.Notification%29" rel="nofollow">foreground service</a>. This will put the service at a higher priority than a background service, and should be interrupted less by the system.</p> <p>However, unless your service NEEDS to run in the foreground, you should implement your service to gracefully handle being torn down and built up by the system, since it usually kills the service for a good reason. Forcing your service into the foreground might increase the risk of hurting overall device performance, and it does force the presence of a persistent notification in the notification bar, which annoys some users (at least me).</p>