title: How to know if current device can have background mode
body: <p>I am doing some tasks after having entered in background mode. I want to do these tasks only if I am in background mode so I did :</p>
  
  <pre><code>if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground)
  </code></pre>
  
  <p>But applicationState is only available in iOS 4.0 and later...</p>
  
  <p>I wonder how this piece of code will work on iOS 3 for example.</p>
  
  <ul>
  <li>How can I know if the device has iOS 4 ?</li>
  <li>How can I avoid crash and exceptions for iOS &lt; 4 ?</li>
  </ul>
  
  <p>Thansk for your help</p>
  
  <p>Kheraud</p>