Due to debugging reason most parts of the code in my application has this recurrent portion of code:
public static final boolean DEBUG = true; // just created once in a "Utility" class if (Utility.DEBUG) Log.d("TIMER", /*string message that is strictly related to context*/); Now, if the boolean values turn to false this becomes dead code. My question is if in this case the Android compiler would do basics optimizations such as constant folding and dead code remotion?
If the answer is no, what is the best way to whip out in release phase the debugging logs?
Utility.DEBUGis a constant as indicated by your code, the dead code should already be removed by the java compiler.