Pages Navigation Menu

Coding is much easier than you think

How to get android api version programmatically

There is different ways to get that programmatically .

First method .

The SDK level (integer) the phone is running is available in:


** UPDATE: Android Complete tutorial now available here.
The enum corresponding to this int is in the android.os.Build.VERSION_CODES class.

int currentapiVersion = android.os.Build.VERSION.SDK_INT;
if (currentapiVersion < = android.os.Build.VERSION_CODES.FROYO)
// Do something for froyo and above versions
// do something for phones running an SDK before froyo


Leave a Comment

Your email address will not be published. Required fields are marked *