I have an Android project that is communicating with an API. However, the API URL is hardcoded into the code.
Coming from a Rails background, it is possible to communicate to a staging server or a production server based on the Rails environment on which is defined in a config file.
I found BuildConfig.java
which contains a DEBUG
variable but warns:
/** Automatically generated file. DO NOT MODIFY */
How can I determine which server to communicate to with Android with best practice? Is there a config file to do so?