title: Android - String comparison between two android version names
body: <p>As the android version names are in String data type, I want to compare the existing apk on my device with the new apk update version name. I know how to get the version name programmatically and I have two version names but string comparision between two version names does not show correct result </p>
  
  <pre><code>if ( oldVersionName.compareTo( newVersionName ) &lt; 0 ) {
  }
  </code></pre>
  
  <p>This compareTo does not work in few scenarioes like 1.0.9 and 1.0.12, 1.0.9 and 1.0.10. </p>
  
  <p>Please give me solution on how to compare two string version names programatically? Thank you! </p>