hsu-hsu / nimble-survey-app

This is an application that allows users to browse a list of surveys.
0 stars 0 forks source link

[Feature] Application flavors handling #19

Closed minhnimble closed 8 months ago

minhnimble commented 8 months ago

As per our API documentation, there are two environments that our API can support: Staging and Production. Now, you handle these environments by setting the BASE_URL settings in the Constants file for Production url only, and it is not the best practice for managing this kind of task.

https://github.com/hsu-hsu/nimble-survey-app/blob/81c798e104ee3a1fa125d72e060540d0ac316a86/app/src/main/java/com/nimble/android/utils/Constants.kt#L5

Thus, I would like to know more about your knowledge on this topic. Do you know any better approach to handle this? If yes, please update the project with some implementation examples. 🙂

By the way, do you have any experience handling DevOps (CI/CD) for different environments? Please brief me on the potential steps in a distribution pipeline per the environment setup.

hsu-hsu commented 8 months ago

Configurations build variants is very important in android and it is my fault I didn’t setup this config in previous submission. Now, I divide productFlavors into two modes(production and staging) and return base api url accordingly. pull request -> #27

hsu-hsu commented 8 months ago

About handling DevOps(CI/CD), I don't have real worl experience. I only tested by myself using Codemagic and configuring a YAML file. In my opinion, if we use Codemagic, I should setup the config with production environment like below.