title: Persistent service
body: <p>I know that some peoples view is that you should not create persistent services. </p>
  
  <p>But for those of us that want to increase our knowledge, how does one go about creating one in theory?</p>
  
  <p>I have been playing around, and noticed that services that use <a href="http://developer.android.com/reference/android/app/Service.html#startForeground%28int,%20android.app.Notification%29" rel="noreferrer">startForeground</a> are killed in low memory situations.</p>
  
  <p>I have seen a, now deprecated, permission <code>PERSISTENT_ACTIVITY</code>, but that didn't do much.</p>
  
  <p>So what is the secret?</p>