In a app I have written I have created methods that help you compare the version of android. It has the following methods:

boolean isOlderThan(int sdkVersion)
boolean isEqualToOrOlderThan(int sdkVersion)
boolean isEqualTo(int sdkVersion)
boolean isEqualOrLaterThan(int sdkVersion)
isLaterThan(int sdkVersion)

I would suggest these be in a seperate class so they can be used anywhere, rather than polluting your class.