use this class
import android.os.Build;
/**
* Created by MOMANI on 2016/04/14.
*/
public class AndroidVersionUtil {
public static int getApiVersion() {
return android.os.Build.VERSION.SDK_INT;
}
public static boolean isApiVersionGraterOrEqual(int thisVersion) {
return android.os.Build.VERSION.SDK_INT >= thisVersion;
}
}