Skip to content

Instantly share code, notes, and snippets.

@sgeto
Forked from benvium/detectAndroidOSVersion.js
Created September 21, 2018 15:08
Show Gist options
  • Save sgeto/cdf119e49c96e258f2f7d1a66d55d84a to your computer and use it in GitHub Desktop.
Save sgeto/cdf119e49c96e258f2f7d1a66d55d84a to your computer and use it in GitHub Desktop.
detect Android OS version number in JavaScript. Found at http://krpano.com/forum/wbb/index.php?page=Thread&threadID=6652
var ua = navigator.userAgent;
if( ua.indexOf("Android") >= 0 )
{
var androidversion = parseFloat(ua.slice(ua.indexOf("Android")+8));
if (androidversion < 2.3)
{
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment