Java tutorial
//package com.java2s; import android.content.Context; import android.content.pm.ApplicationInfo; public class Main { private static Boolean isDebug = null; /** * Sync lib debug with app's debug value. Should be called in module Application. * * @param context */ public static void syncIsDebug(Context context) { if (isDebug == null) { isDebug = context.getApplicationInfo() != null && (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; } } }