title: Android Service needs to run always (Never pause or stop)
body: <p>I created a service and want to run this service always until my phone restarts or force closed. The service should run in background. </p>
  
  <p>Sample code of created service and start services:</p>
  
  <p><strong>Start the service:</strong></p>
  
  <pre><code>Intent service = new Intent(getApplicationContext(), MyService.class);
  getApplicationContext().startService(service);
  </code></pre>
  
  <p><strong>The service:</strong></p>
  
  <pre><code>public class MyService extends Service {
  
      @Override
      public int onStartCommand(Intent intent, int flags, int startId) {
          // TODO do something useful
          HFLAG = true;
          //smsHandler.sendEmptyMessageDelayed(DISPLAY_DATA, 1000);
          return Service.START_NOT_STICKY;
      }
  
      @Override
      public IBinder onBind(Intent intent) {
          // TODO for communication return IBinder implementation
          return null;
      }
  }
  </code></pre>
  
  <p><strong>Manifest declaration:</strong></p>
  
  <pre><code>&lt;service
      android:name=".MyService"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name" &gt;
  &lt;/service&gt;
  </code></pre>
  
  <p>Is it possible to run this service always as when the application pauses and anything else.
  After some time my application goes pause and the services also go pause or stop.
  So how can I run this service in background and always.</p>