Hi All,
This is the simple way to get Android Version from javascript.
1 2 3 4 5 |
function getAndroidVersion(ua) { var ua = ua || navigator.userAgent; var match = ua.match(/Android\s([0-9\.]*)/); return match ? match[1] : false; }; |
Simple way to use:
1 2 3 |
if (navigator.userAgent.match(/android/ig)) { alert(getAndroidVersion()); } |
Done