Java tutorial
//package com.java2s; import android.os.Debug; public class Main { static final boolean CLS_TRACE_DEFAULT = false; public static boolean isDebuggerAttached() { return (Debug.isDebuggerConnected() || Debug.waitingForDebugger()) ? true : CLS_TRACE_DEFAULT; } }