Example usage for android.support.v4 BuildConfig DEBUG

List of usage examples for android.support.v4 BuildConfig DEBUG

Introduction

In this page you can find the example usage for android.support.v4 BuildConfig DEBUG.

Prototype

boolean DEBUG

To view the source code for android.support.v4 BuildConfig DEBUG.

Click Source Link

Usage

From source file:org.y20k.trackbook.helpers.LogHelper.java

public static void d(final String tag, String message) {
    // include logging only in debug versions
    if (BuildConfig.DEBUG || mTesting) {
        Log.d(tag, message);/*w ww  . j a  v  a2  s .c om*/
    }
}

From source file:com.example.ryan.weixindemo.util.DebugLog.java

public static boolean isDebuggable() {
    return BuildConfig.DEBUG;
}

From source file:org.y20k.trackbook.helpers.LogHelper.java

public static void v(final String tag, String message) {
    // include logging only in debug versions
    if (BuildConfig.DEBUG || mTesting) {
        Log.v(tag, message);//from www.  ja v a 2  s . c o  m
    }
}

From source file:com.facebook.appevents.internal.AppEventUtility.java

public static void assertIsNotMainThread() {
    if (BuildConfig.DEBUG) {
        Assert.assertFalse("Call cannot be made on the main thread", isMainThread());
    }//from  w  ww  .  jav  a  2s  . c  o  m
}

From source file:com.facebook.appevents.internal.AppEventUtility.java

public static void assertIsMainThread() {
    if (BuildConfig.DEBUG) {
        Assert.assertTrue("Call must be made on the main thread", isMainThread());
    }// w ww  .j a v a 2s  . c o  m
}

From source file:com.example.shitij.railway.log.Logging.java

/**
 * Function used to com.example.shitij.railway.log exception
 * @param LOG_TAG is the tag for message
 * @param exception is the exception to be logged
 *///from  w  ww  . ja v  a 2  s.c  o m
public static void logException(String LOG_TAG, Exception exception,
        @CommonLibs.Priority.PriorityConstants int priority) {
    switch (priority) {
    case CommonLibs.Priority.VERY_HIGH:

    case CommonLibs.Priority.HIGH:
        if (exception.getMessage() != null) {
            if (BuildConfig.DEBUG)
                Log.e(LOG_TAG, exception.getMessage(), exception);

            else {
                //                        Crashlytics.getInstance().core.logException(exception);
                //                        Sentry.captureException(exception);
            }
        }
        break;

    case CommonLibs.Priority.MEDIUM:

    case CommonLibs.Priority.LOW:

    case CommonLibs.Priority.VERY_LOW:
        if (BuildConfig.DEBUG)
            Log.e(LOG_TAG, exception.getMessage(), exception);
        break;

    default:
        if (BuildConfig.DEBUG)
            Log.e(LOG_TAG, exception.getMessage(), exception);
    }
}

From source file:uz.sag.sagbuyurtmalari.sagbuyurtmalari.ui.ImageGridActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    if (BuildConfig.DEBUG) {
        Utils.enableStrictMode();/*from   www. j a v  a2s  .c  o  m*/
    }
    super.onCreate(savedInstanceState);

    if (getSupportFragmentManager().findFragmentByTag(TAG) == null) {
        final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.add(android.R.id.content, new ImageGridFragment(), TAG);
        ft.commit();
    }
}

From source file:android.com.example.contactslist.ui.ContactDetailActivity.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override//from w  w w  .  j a  v  a  2s  . c  om
protected void onCreate(Bundle savedInstanceState) {
    if (BuildConfig.DEBUG) {
        // Enable strict mode checks when in debug modes
        Utils.enableStrictMode();
    }
    super.onCreate(savedInstanceState);

    // This activity expects to receive an intent that contains the uri of a contact
    if (getIntent() != null) {

        // For OS versions honeycomb and higher use action bar
        if (Utils.hasHoneycomb()) {
            // Enables action bar "up" navigation
            getActionBar().setDisplayHomeAsUpEnabled(true);
        }

        // Fetch the data Uri from the intent provided to this activity
        final Uri uri = getIntent().getData();

        // Checks to see if fragment has already been added, otherwise adds a new
        // ContactDetailFragment with the Uri provided in the intent
        if (getSupportFragmentManager().findFragmentByTag(TAG) == null) {
            final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();

            // Adds a newly created ContactDetailFragment that is instantiated with the
            // data Uri
            ft.add(android.R.id.content, ContactDetailFragment.newInstance(uri), TAG);
            ft.commit();
        }
    } else {
        // No intent provided, nothing to do so finish()
        finish();
    }
}

From source file:com.designedbyhumans.inappbilling.util.Security.java

/**
 * Verifies that the data was signed with the given signature, and returns
 * the verified purchase. The data is in JSON format and signed
 * with a private key. The data also contains the {@link PurchaseState}
 * and product ID of the purchase.//from   w  w  w  .j  a  v  a2s.  c om
 * @param base64PublicKey the base64-encoded public key to use for verifying.
 * @param signedData the signed JSON string (signed, not encrypted)
 * @param signature the signature for the data, signed with the private key
 */
public static boolean verifyPurchase(String base64PublicKey, String signedData, String signature) {
    if (TextUtils.isEmpty(signedData) || TextUtils.isEmpty(base64PublicKey) || TextUtils.isEmpty(signature)) {
        Log.e(TAG, "Purchase verification failed: missing data.");
        if (BuildConfig.DEBUG) {
            return true;
        }
        return false;
    }

    PublicKey key = Security.generatePublicKey(base64PublicKey);
    return Security.verify(key, signedData, signature);
}

From source file:com.lyft.android.scissors.Utils.java

public static Future<Void> flushToFile(final Bitmap bitmap, final Bitmap.CompressFormat format,
        final int quality, final File file) {

    return EXECUTOR_SERVICE.submit(new Runnable() {
        @Override//from  www . j  a  va  2s. co m
        public void run() {
            OutputStream outputStream = null;

            try {
                file.getParentFile().mkdirs();
                outputStream = new FileOutputStream(file);
                bitmap.compress(format, quality, outputStream);
                outputStream.flush();
            } catch (final Throwable throwable) {
                if (BuildConfig.DEBUG) {
                    Log.e(TAG, "Error attempting to save bitmap.", throwable);
                }
            } finally {
                closeQuietly(outputStream);
            }
        }
    }, null);
}