【Android】SDK和API Level版本的对应关系
2015-11-24 11:08
225 查看
这里记录一下android的SDK和API版本号之间的对应关系,方便以后的查看。
官方API Level地址: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels
In order to provide the best user experience on the latest devices, we recommend that you use the latest platform version as your build target. You’ll still be able to run your app on older versions, but you must build against the latest version in order to use new features when running on devices with the latest version of Android.To get started, download the latest Android version, plus the lowest version you plan to support (we recommend Android 2.2 for your lowest version).
【参考资料】:
http://developer.android.com/sdk/installing/adding-packages.html#Recommended
官方API Level地址: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels
平台版本 | API 级别 | VERSION_CODE | 备注 |
---|---|---|---|
Android 7.0 | 24 | N | 平台亮点 |
Android 6.0 | 23 | M | 平台亮点 |
Android 5.1 | 22 | LOLLIPOP_MR1 | |
Android 5.0 | 21 | LOLLIPOP | |
Android 4.4W | 20 | KITKAT_WATCH | 仅限 KitKat for Wearables |
Android 4.4 | 19 | KITKAT | 平台亮点 |
Android 4.3 | 18 | JELLY_BEAN_MR2 | 平台亮点 |
Android 4.2、4.2.2 | 17 | JELLY_BEAN_MR1 | 平台亮点 |
Android 4.1、4.1.1 | 16 | JELLY_BEAN | 平台亮点 |
Android 4.0.3、4.0.4 | 15 | ICE_CREAM_SANDWICH_MR1 | 平台亮点 |
Android 4.0、4.0.1、4.0.2 | 14 | ICE_CREAM_SANDWICH | |
Android 3.2 | 13 | HONEYCOMB_MR2 | |
Android 3.1.x | 12 | HONEYCOMB_MR1 | 平台亮点 |
Android 3.0.x | 11 | HONEYCOMB | 平台亮点 |
Android 2.3.4 Android 2.3.3 | 10 | GINGERBREAD_MR1 | 平台亮点 |
Android 2.3.2 Android 2.3.1 Android 2.3 | 9 | GINGERBREAD | |
Android 2.2.x | 8 | FROYO | 平台亮点 |
Android 2.1.x | 7 | ECLAIR_MR1 | 平台亮点 |
Android 2.0.1 | 6 | ECLAIR_0_1 | |
Android 2.0 | 5 | ECLAIR | |
Android 1.6 | 4 | DONUT | 平台亮点 |
Android 1.5 | 3 | CUPCAKE | 平台亮点 |
Android 1.1 | 2 | BASE_1_1 | |
Android 1.0 | 1 | BASE |
举例
例如以下的 build.gradle 配置文件指定了项目兼容的最低android API版本号:minSdkVersion 16,那么该项目兼容的系统版本就是Android 4.1.2以上的机型。
apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "com.example.cook" minSdkVersion 16 targetSdkVersion 22 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } }
不过一般Android 应用开发该用哪个版本的 SDK 呢?
Google官方强烈建议,永远只用最新的SDK版本。你的app能运行的Android版本不是由SDK决定的,是由每一个项目的minSDK决定的。In order to provide the best user experience on the latest devices, we recommend that you use the latest platform version as your build target. You’ll still be able to run your app on older versions, but you must build against the latest version in order to use new features when running on devices with the latest version of Android.To get started, download the latest Android version, plus the lowest version you plan to support (we recommend Android 2.2 for your lowest version).
【参考资料】:
http://developer.android.com/sdk/installing/adding-packages.html#Recommended
相关文章推荐
- TUST项目知识点总结(Android端V1.0)
- android原生系统老系统不支持localstorage
- 50个Android开发技巧(01 好好利用layout_weight属性)
- Android VideoView简单播放视频
- android 常见分辨率(mdpi、hdpi 、xhdpi、xxhdpi )及屏幕适配注意事项
- Android开发技巧——自定义控件之自定义属性
- Android开发技巧——自定义控件之自定义属性
- AndroidStudio配置SVN以及使用代码管理
- Android技术博客收藏(持续更新)
- Android开发进阶系列(八) 界面美化之自定义弹出框
- android使用获取所有应用的资源id和uri
- Android-在手机本地保存数据和读取数据
- Android Studio 使用Gradle在Terminal终端用命令打包
- Android的四种启动模式(launchModel)
- Android开源库
- Android性能优化之常见的内存泄漏
- notification的几种使用方法
- Android-Fragment动态例子
- Android开发进阶系列(七) 使用数据库
- Android VideoView简单播放视频