1

Is there any way to change Android application's configuration at build time? I would like to use the same code base for multiple apps and change only a few "parameters" such as:

  • application icon
  • package name/application id
  • application name (displayable)
  • backend endpoints
  • Fabric/Analytics tokens/keys etc.

I know I can achieve this by using buildVariants/productFlavors, but I want to know if there is any way to to this from "command line" during/before build time without modifying application code or gradle files.

fragon
  • 3,391
  • 10
  • 39
  • 76
  • I can imagine you could use a `gradle.properties` file to inject runtime values via `BuildConfig`. Similar to this http://stackoverflow.com/questions/17197636/is-it-possible-to-declare-a-variable-in-gradle-usable-in-java but instead of hardcoded values, you use values added to the gradle.properties file. But this still means you need to do changes in code/gradle file – Budius Sep 26 '16 at 19:13

0 Answers0