-5

Need a solution to build a apk that includes all build variants like mock, QA, DEV and change them with a drop down menu in the app.

Thanks in advance

1 Answers1

0

This is not readily possible. As the google documentation says, "Each build variant represents a different version of your app that you can build." So, you're asking for an apk that includes other apks.

However, depending on what the differences are between your different variants, you can include those in some configuration object and then just switch between them according to the drop down menu. I've seen this used when the differences are just the API endpoints.

Or, if that's not possible and you do end up having to use different apk's, then you can load all of them and have another main apk that you can use to launch the right one based on some menu.

awardak
  • 322
  • 3
  • 10
  • Thanks for your input . so you are saying i need to install all the apks in the device and open what ever i need with the main apk right? thats kind of cheating :p yes i have done this for a webapp by just changing the endpoint based on environment. – beat of andhra Mar 10 '17 at 03:43
  • Why is it cheating? It's probably the cleanest way to achieve what you're looking for. – awardak Mar 10 '17 at 03:53