How to retrieve the android sdk version?

Arutha picture Arutha · Dec 10, 2009 · Viewed 70.9k times · Source

How can I get the current Android SDK version(1.5, 1.6, 2.0, etc.) programmatically?

Answer

Erich Douglass picture Erich Douglass · Dec 10, 2009

The String Build.VERSION.RELEASE will give you the user-visible version string (i.e 1.5, 1.6, 2.0), while Build.VERSION.SDK_INT will give you a value from Build.VERSION_CODES that would be better to use if you want to compare against it programatically.