jennifer
jennifer

Reputation: 8261

Android device version

How can i get the current android deveice version (1.5, 1.6, 2.0, etc.) programmatically. i.e I have installed my apk in ANdroid 2.2 device.. I need to get the device version (android emulator version in which my application is currently running )

Upvotes: 2

Views: 8060

Answers (2)

Jems
Jems

Reputation: 11620

The integer representing the API level can be found at android.os.Build.VERSION.SDK_INT

So you could do:

int apiLevel = android.os.Build.VERSION.SDK_INT;

The possible values of that integer across all devices can be found in here. If you want to compare versions against a named release of android, use the name of each constant here. You cannot compare the device version against the release numbers like 2.1 , 2.2 etc. so if you want to do that you must use the release name or API level, and then convert manually.

Upvotes: 10

ingsaurabh
ingsaurabh

Reputation: 15267

Look at following post might help How can I check in code the Android version like 1.5 or 1.6

Upvotes: 6

Related Questions