Java tutorial
//package com.java2s; import android.content.Context; import android.content.pm.ApplicationInfo; public class Main { public static boolean isDebug = false; public static void setIsDeBug(Context context) { ApplicationInfo applicationInfo = context.getApplicationInfo(); try { isDebug = ((applicationInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0); } catch (Exception e) { isDebug = false; e.printStackTrace(); } } }