获取当前正在运行我的应用程序的手机的Android API级别

如何获得当前运行应用程序的电话的Api级别?我相信它很简单,但是我找不到,因为我所有的搜索都带来了大量的垃圾。



一只名叫tom的猫
浏览 628回答 3
3回答

皈依舞

Integer.valueOf(android.os.Build.VERSION.SDK);值是:Platform Version&nbsp; &nbsp;API LevelAndroid 9.0&nbsp; &nbsp; &nbsp; &nbsp; 28Android 8.1&nbsp; &nbsp; &nbsp; &nbsp; 27Android 8.0&nbsp; &nbsp; &nbsp; &nbsp; 26Android 7.1&nbsp; &nbsp; &nbsp; &nbsp; 25Android 7.0&nbsp; &nbsp; &nbsp; &nbsp; 24Android 6.0&nbsp; &nbsp; &nbsp; &nbsp; 23Android 5.1&nbsp; &nbsp; &nbsp; &nbsp; 22Android 5.0&nbsp; &nbsp; &nbsp; &nbsp; 21Android 4.4W&nbsp; &nbsp; &nbsp; &nbsp;20Android 4.4&nbsp; &nbsp; &nbsp; &nbsp; 19Android 4.3&nbsp; &nbsp; &nbsp; &nbsp; 18Android 4.2&nbsp; &nbsp; &nbsp; &nbsp; 17Android 4.1&nbsp; &nbsp; &nbsp; &nbsp; 16Android 4.0.3&nbsp; &nbsp; &nbsp; 15Android 4.0&nbsp; &nbsp; &nbsp; &nbsp; 14Android 3.2&nbsp; &nbsp; &nbsp; &nbsp; 13Android 3.1&nbsp; &nbsp; &nbsp; &nbsp; 12Android 3.0&nbsp; &nbsp; &nbsp; &nbsp; 11Android 2.3.3&nbsp; &nbsp; &nbsp; 10Android 2.3&nbsp; &nbsp; &nbsp; &nbsp; 9Android 2.2&nbsp; &nbsp; &nbsp; &nbsp; 8Android 2.1&nbsp; &nbsp; &nbsp; &nbsp; 7Android 2.0.1&nbsp; &nbsp; &nbsp; 6Android 2.0&nbsp; &nbsp; &nbsp; &nbsp; 5Android 1.6&nbsp; &nbsp; &nbsp; &nbsp; 4Android 1.5&nbsp; &nbsp; &nbsp; &nbsp; 3Android 1.1&nbsp; &nbsp; &nbsp; &nbsp; 2Android 1.0&nbsp; &nbsp; &nbsp; &nbsp; 1注意:请勿使用android.os.Build.VERSION.SDK_INTif <uses-sdk android:minSdkVersion="3" />。您将在所有Android 1.5及更低版本的设备上获得异常,因为Build.VERSION.SDK_INT自SDK 4(Donut 1.6)起。

茅侃侃

android.os.Build.VERSION.SDK_INT您可以在这里找到可能的值:VERSION_CODES。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Android