I have a source file in my project at app/src/(product name)/util
. I also have two possible build variants of my product. You could view this as white labeling, but it's really just for targeting a test server vs. production. These files just contain a variety of string constants, used for things like the server address and access keys for the API. This is separate from the application's production vs. beta.
- I can't do an
#ifdef
, of course. - Even if I put them in different folders, but I need to import them using
com.productname.(target).ServiceConfig.java
which I can't do.
How do I include a different set of string constants in each build variation?
The goal is to differentiate the builds by about 4-5 strings so I'm open to other options.
This is an inherited project, several years out of date, but I'm building it with the latest Android Studio and gradle.
(Suggesting tags in a comment would be welcomed, too, as would help with rephrasing unclear parts of this question. I don't have deep enough knowledge to be confident I've asked this well.)