Reputation: 241
I want to give the ability to testers to switch API URLs inside my app. And I want to do it only in the internal testing stage(not in the closed testing/production). So I need something like environment variables. Is there some ability for that?
I tried to find the answer in the docs but no results
Upvotes: 3
Views: 957
Reputation: 66
The testing stage will not affect your app, if you want to support api url switch in internal testing , you have to upload a custom apk in internal testing satage. use build varient to generate different apk . for example:
android {
...
defaultConfig {...}
buildTypes {
debug{...}
release{...}
}
// Specifies one flavor dimension.
flavorDimensions "version"
productFlavors {
internaltest {
dimension "version"
}
production {
dimension "version"
}
}
}
then add api url switch according to BuildConfig.FLAVOR
Upvotes: 1