title: how to compare Android versions
body: <p>I am trying to create a condition in my code to compare Android versions.Something akin to;</p>
  
  <pre><code>if(version &lt; 2.2)
  {// TODO } 
  else
  {// TODO }
  </code></pre>
  
  <p>Would anyone please let me know how to do this?</p>