0

My Android project is using gradle build:

signingConfigs {
        debug {
            ...
        }

        release {
           ...
        }
    }

buildTypes {
        debug {
            ...
        }
        release {
          ...
        }
 }

I am wondering is there a way to detect the current build type in Java code of Android project? How to achieve this?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Leem
  • 17,220
  • 36
  • 109
  • 159

1 Answers1

1

There are BuildConfig class in your project that contains app id, build type, flavors and other.

Andrew
  • 1,383
  • 7
  • 21
  • Where can I find the official documentation for it? I can't find in developer site. – Leem Feb 09 '18 at 15:40
  • There are no official documentation but there https://developer.android.com/studio/build/gradle-tips.html#simplify-app-development you may find how to insert custom fields into BuildConfig. – Andrew Feb 09 '18 at 15:48