I am planning to add a DEBUG flag, and adding an if statement before every Log.d call
public static final boolean DEBUG = FALSE;
if (DEBUG)
{
Log.d(TAG,"Debug"); //dead code
}
Will the dead code going to be removed in compile time, or will the if statement is going to be called on every time ?
Your debug code will always be executed (always the if).
By the way, Android already has this type of flag:
BuildConfig.DEBUG