例如判断API版本大于19(即android4.4)
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.KITAT){}
Build.VERSION_CODES类下面的版本信息(这是android.jar4.4.2版本中的源码)
public static class VERSION_CODES {
/**
* Magic version number for a current development build, which has
* not yet turned into an official release.
*/
public static final int CUR_DEVELOPMENT = 10000;
/**
* October 2008: The original, first, version of Android. Yay!
*/
public static final int BASE = 1;
/**
* February 2009: First Android update, officially called 1.1.
*/
public static final int BASE_1_1 = 2;
/**
* May 2009: Android 1.5.