Code2care : TechZone Apps & Tutorials

How to get the Android OS installed version programmatically

There are always certain new features added to later/newer versions of android SDK that are not supported by older devices. For such scenarios one need to know the version of Android OS running on a device so as to customize the code functionality accordingly.
int currentVer = android.os.Build.VERSION.SDK_INT;
Log.i("Activity", currentVer);
if( currentVer == FROYO ) {
         //Some code
      }
    else if ( currentVer == GINGERBREAD ) {
         //Some code
    }
    else {
         //Some code
   }








Popular tags
android
x 175
eclipse
x 29
notepadplusplus
x 20
macosx
x 14
sharepoint
x 14
html
x 14
mac
x 13
androidstudio
x 11




1000+ C Programs     PHP Tutorial     JSON Tutorial     Swift Tutorial     India Pinocdes     About Us     Privacy Policy


Code2care © 2012-17