I have a two flavor for my app. This two flavor use different baseurl. I have 4 url totally.
admintest
adminrelease
usertest
userrelease
android {
...
defaultConfig {...}
buildTypes {
debug{ //baseurl for debug }
release{ //baseurl for release }
}
// Specifies one flavor dimension.
flavorDimensions "version"
productFlavors {
user {
}
admin {
}
}
}
I only set one url in debug and relase now and I cant find how can I set url for each flavor.
Thanks for any advice.
You can see in below image i have flavors of my app
is used as common for all.
here i created separate
strings.xml
which will overwrite the mainstrings.xml
for same string_name.Example
lets suppose you have
base_url
string insrc >> main >> strings.xml
when you are using (in my case) falvorVersionTwo.
if you added
base_url
string insrc >> flavorVersionTwo >> strings.xml
then it will overwrite thebase_url
written in main->strings.xml.Note:
For more understanding you can Read this and this