Buildconfig. debug in Android

Source: Internet
Author: User

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 ");}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.