- Home /
How to get Andriod API level?
Hi, Is there way to get Andriod API level from unity? If not, is here something by what I could know if it is good(S5) or bad(S3 mini). Then I could decided if I want to use particle effects on device or not?
Answer by steakpinball · May 29, 2015 at 03:33 PM
Fairly simple.
static int getSDKInt() {
using (var version = new AndroidJavaClass("android.os.Build$VERSION")) {
return version.GetStatic<int>("SDK_INT");
}
}
http://developer.android.com/reference/android/os/Build.VERSION.html#SDK_INT
Keep in mind the API level does not tell you whether the device is "good" or"bad".
Answer by enochmanju · Nov 16, 2016 at 01:09 PM
@Nexgea, Try this :
int apiLevel = int.Parse (SystemInfo.operatingSystem.Substring(SystemInfo.operatingSystem.IndexOf("-") + 1, 3));
Your answer
![](https://koobas.hobune.stream/wayback/20220613200416im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Required API 26 0 Answers
Unity 2017 not giving option for latest target API level 26 or higher. 3 Answers
Error importing asset from google poly api in android build unity 0 Answers
Anyone implement youtube api in unity 1 Answer
Android API Level < 9 1 Answer