I am creating an application that uses the Android library as the main source of code. Then I have several applications using this library; these applications will have the same code, but different configuration fields, such as endpoints, etc.
To achieve this, I thought I could have buildConfigField in my build.gradle library and then override this value in my build.gradle application with the same name, for example:
build.gradle in the library:
buildConfigField "String", "API_BASE_URL", "\"http://arandomapibaseurl.com\""
build.gradle in the application:
buildConfigField "String", "API_BASE_URL", "\"http://myrealapi.com\""
Any ideas on how to do this?
Thanks!
Jorge source share