Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To get android os version at run time [duplicate]

Does anyone know how can I check the system version (e.g. 1.0, 2.2, etc.) programatically?

like image 751
davs Avatar asked Jun 22 '10 13:06

davs


People also ask

How do I make my Android device version programmatically?

This example demonstrates how do I retrieve android API version programmatically. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml.

What is build version Sdk_int?

Build. VERSION. SDK_INT: The SDK version of the software currently running on this hardware device. in other words - this is the Android version of the device running the app.

What is the SDK version of Android 11?

Android 11 (API level 30)


1 Answers

Example how to use it:

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD) {
     // only for gingerbread and newer versions
}
like image 125
ATom Avatar answered Oct 02 '22 14:10

ATom