How do I get the Api level of the phone curently running my application? I am sure its simple but I can not find it as all my searches bring up tons of junk.
Thank you just could not see it ;)
Doodle
2010-10-22 18:00:37
A:
android.os.Build.VERSION.SDK_INT
Here you can find the possible values: VERSION_CODES
.
Cristian
2010-10-22 04:41:45
A:
Integer.valueOf(android.os.Build.VERSION.SDK);
Values are:
Platform Version API Level
Android 2.2 8
Android 2.1 7
Android 2.0.1 6
Android 2.0 5
Android 1.6 4
Android 1.5 3
Android 1.1 2
Android 1.0 1
CAUTION: don't use android.os.Build.VERSION.SDK_INT
if <uses-sdk android:minSdkVersion="3" />
.
You will get exception on all devices with Android 1.5 and lower because Build.VERSION.SDK_INT
is since SDK 4 (Donut 1.6).
rude
2010-10-22 09:11:15