简体   繁体   中英

Android application compatibility with old APIs

我使用API​​ 22创建了一个应用,我想知道是否有必要创建一个新项目以使其与以前的版本兼容(例如与API 19兼容),或者我是否可以做一些更简单有效的事情

If you're using gradle just set the minSdkVersion to the number you'd like to use:

defaultConfig {
    applicationId "com.example.mypackage"
    minSdkVersion 16
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}

in the app's build.gradle file

There are 2 way,

1) Set your "minSdkVersion" from gradle file

or

2) In Android Studio,

File --> Project Structure --> app (on left menu) --> Flavors

then set "Min Sdk Version"

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM