简体   繁体   English

当我在 Android Studio 中创建一个新项目时,我应该根据项目类型选择哪个 API 级别作为最低 SDK?

[英]When I create a new project in Android Studio, which API level should I choose according to project type as the minimum SDK?

For example, for which project content should I choose API 21:Android 5.0(Lollipop)?例如,我应该为哪个项目内容选择 API 21:Android 5.0(Lollipop)? Or for which project content should I choose API 16:Android 4.1(Jelly Bean)?或者我应该为哪个项目内容选择 API 16:Android 4.1(Jelly Bean)? etc. In short, what should we consider when choosing API levels in Android Studio?等等。简而言之,在Android Studio中选择API关卡应该考虑什么? API Levels API 级别

It depends on the project, and the api's you will use like there is some libraries that doesn't support old api levels like 16 and below, so first choose low api like 16(Android 4.1) then if u include some api's that needs higher minimum sdk you can increase it from (build.gradle):这取决于项目,您将使用的 api 就像有些库不支持旧的 api 级别(如 16 及以下),所以首先选择低 api 像 16(Android 4.1)然后如果您包含一些需要更高级别的 api最低 sdk 你可以从(build.gradle)增加它:

defaultConfig {
    applicationId "Your app package"
    //this is the minimum sdk
    minSdkVersion 21
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Android Studio中创建新项目时如何选择目标API级别? - How to choose target API level when creating a new project in Android Studio? Android Studio:列出需要SDK级别高于项目最低级别的所有调用 - Android Studio: List all calls which requires SDK level above the project minimum level 为什么在启动新项目时需要选择API级别? - Why do I need to choose an API level when I start a new project? 什么是最低SDK,我应该选择哪一个 - What is the Minimum SDK and which one should I choose 当我创建新项目时,Android studio 没有显示 - Android studio not showing when I create new project 在Android Studio上创建新项目时没有模板 - No template when I create a new project on android studio 为什么在我创建新项目时android studio中出现这个错误? - why this errors in android studio occurred when i create new project? 在新的 Android Studio 项目中,我应该在哪里为 firebase 添加项目级依赖项 - Where should I add project level dependencies for firebase in new Android Studio projects 如何在Android Studio中为新项目选择语言级别? - How to choose Language Level for new project in Android Studio? Eclipse Android-当我选择文本图标时,它不会创建项目 - Eclipse Android - when i choose text icon it does not create project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM