DEBUG variable in Eclipse

In case you missed cool feature of ADT v.17

“Added a feature that allows you to run some code only in debug mode. Builds now generate a class called BuildConfig containing a DEBUG constant that is automatically set according to your build type. You can check the (BuildConfig.DEBUG) constant in your code to run debug-only functions such as outputting debug logs.”

Can help a lot:) Everybody forgets to disable debug in release at least one time in life.

//DL

Share
  • Lopa

    And it doesn’t work (at least, for me), unless you disable “build automatically”.
    Everybody forgets to disable “build automatically” in release at least one time in life.

  • villain_dm

    It works perfectly when you use Eclipse for debug (just run with debug certificate) and “ant release” for production. Your case seems like a bug. Is it reproducible in ADT v.20? submit bug at http://tools.android.com/