Today, I saw someone using buildconfig. Debug on the Internet. Later I checked that buildconfig was automatically generated under the gen directory. In addition, the default value of buildconfig. debug is true, indicating that it is automatically generated and cannot be modified. But I tried to modify it. You can also modify it. Later, I checked the online information to find out that it was used for debugging. That is to say, it is used to determine whether to print the debugging statement or log file. In this way, you do not need to define constants. For example, it is used to debug a program.
If (buildconfig. Debug) {utils. enablestrictmode ();}
This code is only executed in the development phase. After the application is packaged through export, buildconfig. debug automatically becomes false. It will not be executed. Print debugging information. For example:
If (buildconfig. Debug) {log. D (TAG, "Out debug ");}