Code example for PackageManager

Methods: getApplicationInfo

0
 
    private boolean isDebuggable(Context context) {
        PackageManager manager = context.getPackageManager();
        ApplicationInfo appInfo = null;
        try { 
            appInfo = manager.getApplicationInfo(context.getPackageName(), 0);
        } catch (NameNotFoundException e) {
            return false; 
        } 
        if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) == ApplicationInfo.FLAG_DEBUGGABLE) {
            return true; 
        } 
        return false; 
    } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE