问题
I am building an app that has two APKs: one for tablets and the other for mobiles.
The tablet version won't use the drawable of the mobile APK and vice versa.
I want to do this because of APK size.
Can anyone give me pointers how to achieve this?
I tried to use flavors for this but it can make the two APK.
回答1:
You can use Android Flavors for this purpose.
android {
...
defaultConfig {...}
buildTypes {...}
productFlavors {
tablet {
applicationIdSuffix ".tablet"
versionNameSuffix "-tablet"
}
phone {
applicationIdSuffix ".phone "
versionNameSuffix "-phone "
}
}
}
Each flavor will create separate build folders,where you can place resource files you wish to override. Here is an excellent tutorial: Mastering "Product Flavors" on Android
回答2:
You can achieve this, as Google play store providing support for multiple apks. You can check here for more details- Creating Multiple APKs for Different Screen Sizes
来源:https://stackoverflow.com/questions/43090052/different-resource-folders-for-separate-tablet-mobile-apks