我怎样才能获得当前 Android SDK中
版本(1.5,1.6,2.0,等)编程?
How can I get the current Android SDK
version(1.5, 1.6, 2.0, etc.) programmatically?
字符串 Build.VERSION.RELEASE
会给你的用户可见的版本字符串(如1.5, 1.6,2.0),而 Build.VERSION.SDK_INT
会给你从 Build.VERSION_值codeS
这将是更好地使用,如果你想反对它来比较编程。
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.