I'm trying to apply the equivalent of Android's product flavor with a Java library. My project configuration can be resumed in:
- App module (type: Android application)
- Api calls module (type: Java library)
The app module only has one product flavor (the default one) and the api module will have several ones, one per environment (local, preproduction server and production server).
I've been checking some questions and I've found this one that achieves something similar to product flavors with only Java projects. There is also this other question that explains how to get android libraries with product flavors.
My question is: can an Android app module define a dependency on a Java library module defining the library configuration?
Should I refactor my architecture making the Android app module has several product flavors, in each one passing the configuration parameters to the Java library?