Using different backends for test and prod versions of an Android app

Viewed 445

Suppose I have an Android app that I want to run through the entire release track - closed test by development/QA, beta test by selected users, staged rollout, production

Development version is using a separate development backend, beta version is using a staging backend, production version is using production backend. They have different API endpoints, databases, keys, etc.

As far as I understand the recommended solution is to build different flavors with different settings. But that defeats the idea of release track as the release version is different from the test version.

Also pushing updated release version will force out previous test versions with lower version codes, so I'll probably need to push immediately more test versions to continue testing.

Are there any better solutions? I'd also prefer to avoid hidden settings for switching backends and sideloading test versions.

2 Answers

The easiest way to do it is to look at a file on your phone's local directory (or in downloads) settings.json. If it exists, override your base configuration with the contents of the file. If not, use the defaults. Then you can change settings by adb pushing different settings files to the device.

I would recommend using something like Firebase Remote Config then you can change the settings as your server rollouts happen. This sort of server side configuration is what app developers with millions of users do.

Related