Is it possible to build apk with more than 1 product flavor?
For example: I have a Project with 3 flavors (App1 - App2 - App3).
and each app has its own configurations such as applicationId and so on.
and now I want to build different templates (different XML layouts), and the user should be able to switch from layout to another from inside the app.
My problem is the res folder will be huge and it will be hard to maintain, so I'm trying to find a way to separate the different layouts and keep it clean as much as possible.
And if it's possible to do so, then how do I intent or restart the app to the other flavors build?
Another thing I had in mind was to build all XML files in the main res and choose different qualifiers like when we do while creating different screen size (sm - larg - etc.. ) but i couldnt find anyway to add custom qualifiers.
My Gradle
code is like this :
flavorDimensions "default"
productFlavors {
demo {
applicationId "test.demo"
versionCode 2
versionName "1.1.2"
resValue "string", "backage_name_file", "test.demo.fileprovider"
resValue "string", "bc", "com.demo"
resValue "string", "bc_e", "extra_data.com.demo"
resValue "string", "default_hostname", "demo.test.com"
resValue "string", "default_username", "demo"
resValue "string", "default_password", "demo"
}
AppOne {
applicationId "test.AppOne"
versionCode 2
versionName "1.1.2"
resValue "string", "backage_name_file", "test.AppOne.fileprovider"
resValue "string", "bc", "com.AppOne"
resValue "string", "bc_e", "extra_data.com.AppOne "
resValue "string", "default_hostname", "AppOne.test.com"
resValue "string", "default_username", "AppOne"
resValue "string", "default_password", "AppOne"
}
AppTwo {
applicationId "test.AppTwo"
versionCode 2
versionName "1.1.2"
resValue "string", "backage_name_file", "test.AppTwo.fileprovider"
resValue "string", "bc", "com.AppTwo"
resValue "string", "bc_e", "extra_data.com.AppTwo"
resValue "string", "default_hostname", "demoAppTwotest.com"
resValue "string", "default_username", "AppTwo"
resValue "string", "default_password", "AppTwo"
}
}
from Build Single Apk with multiable template/flavors
No comments:
Post a Comment