title: How to create a breakpoint programmatically on Android
body: <p>In C# I can write:</p>
  
  <pre><code>if(Debugger.IsAttached)
      Debugger.Break();
  </code></pre>
  
  <p>This has no effect when the program is not being debugged. When a debugger is attached, it behaves like a breakpoint that can never be turned off. How can I achieve similar effect on Android?</p>
  
  <p>Or maybe I should not focus on breakpoints at all. What I really want is to have no consequence in regular use (a generic error message will be shown to the user), but have the source of error become obvious the moment a dev will start looking at it. I've tried assert, but it's a sub-project that's compiled to release flavor most of the time and I can't rely on someone remembering to switch it to debug.</p>