android - Google Play 的目标 API 级别要求的问题

标签 android

来自文章https://developer.android.com/distribute/best-practices/develop/target-sdk ,

Google Play 将要求新应用从 2018 年 8 月 1 日起至少以 Android 8.0(API 级别 26)为目标,并且应用更新从 2​​018 年 11 月 1 日起以 Android 8.0 为目标。

以下代码来 self 的应用。

1:是不是说targetSdkVersion必须大于等于26?

2:是不是说minSdkVersion可以是21?

代码

defaultConfig {

        applicationId "info.dodata.mirror"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 9
        versionName "1.09"
        archivesBaseName = "My-V" + versionName
    }

最佳答案

1: Does it mean that targetSdkVersion must be greater than or equal to 26 ?

是的。

2: Does it mean that minSdkVersion can be 21 ?

是的。 (或您需要支持的任何较低版本)

来自documentation :

android:minSdkVersion

An integer designating the minimum API Level required for the application to run. The Android system will prevent the user from installing the application if the system's API Level is lower than the value specified in this attribute. You should always declare this attribute.

android:targetSdkVersion

An integer designating the API Level that the application targets. If not set, the default value equals that given to minSdkVersion. This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version. The application is still able to run on older versions (down to minSdkVersion).

关于android - Google Play 的目标 API 级别要求的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52233892/

相关文章:

android - Sqlite 数据库未从 Android Assets 文件夹复制

android - OkHttp 和 Retrofit,并发请求刷新 token

android - 我怎样才能让 EditText 发生变化?

Android ImageView缩放冲突

android - 9 补丁 png 不能正常工作的背景

java - 创建支持不同屏幕尺寸的相同 UI?

android - 如何测试android抽象 Activity ?

android - 带 BiChannelGoogleApi : [FirebaseAuth: ] getGoogleApiForMethod() returned Gms

android - Recyclerview - smoothScrollToPosition 到列表顶部,然后动画添加项目

android - sagepay 是否有适用于 iOS 和/或 Android 的应用内支付的任何库或 SDK?