Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;

import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager.NameNotFoundException;

public class Main {
    private static boolean debug = false;

    public static void DEBUG(Context c) {
        try {
            debug = (c.getPackageManager().getApplicationInfo(c.getPackageName(), 0).flags
                    & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
        } catch (NameNotFoundException e) {
            e.printStackTrace();
        }
    }

    public static boolean DEBUG() {
        return debug;
    }
}