Check Android Version of an android device via code
by Sasikumar[ Edit ] 2013-10-14 10:09:49
To check the android version use the following method
Step 1: Get the current sdk version with following code
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
Step 2: Use if condition to check the required version as follows
if (currentapiVersion == android.os.Build.VERSION_CODES.HONEYCOMB)
{
}
elseif (currentapiVersion == android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH)
{
}
elseif (...)
{
//similarly other versions
}
Note: You can get Version Codes for each version from this link,
Get Version Codes