What's the advantage of putting a buildConfigField
to my flavor via gradle in comparison with a Constants.java
file per flavor?
Also what's the advantage of putting a resValue
to my flavor via gradle in comparison with regular resources per flavor?
Thanks!
What's the advantage of putting a buildConfigField to my flavor via gradle in comparison with a Constants.java file per flavor?
First, it is less typing. With buildConfigField
, it's one line of Groovy code per flavor. With Constants.java
, it is a separate Java class per flavor.
Second, the value could be code generated by Groovy code in the build script, and that's a whole lot easier than code generating a Java class (though the latter is certainly possible).
Also what's the advantage of putting a resValue to my flavor via gradle in comparison with regular resources per flavor?
Pretty much the same as above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With