How can I find out which API level my device is using?
The firmware version is 1.6. Does that mean it uses API Level 4?
If you are on at least API version 4 (Android 1.6 Donut), the current suggested way of getting the API level would be to check the value of android. os. Build. VERSION.
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. In the above code, we have taken text view to show device version number.
API Level is an integer value that uniquely identifies the framework API revision offered by a version of the Android platform. The Android platform provides a framework API that applications can use to interact with the underlying Android system. The framework API consists of: A core set of packages and classes.
You can obtain API level programatically by the system constant (Build.VERSION.SDK_INT
). For example you can run some piece of code which requires newer API in the following way (it will execute if the current device's API level is at least 4)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.DONUT) { }
To obtain user visible Android Version use:
Build.VERSION.RELEASE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With