Example usage for android.util Log DEBUG

List of usage examples for android.util Log DEBUG

Introduction

In this page you can find the example usage for android.util Log DEBUG.

Prototype

int DEBUG

To view the source code for android.util Log DEBUG.

Click Source Link

Document

Priority constant for the println method; use Log.d.

Usage

From source file:com.facebook.stetho.server.LocalSocketHttpServer.java

@Nonnull
private static LocalServerSocket bindToSocket(String address) throws IOException {
    int retries = MAX_BIND_RETRIES;
    IOException firstException = null;
    do {/* ww w . j a  v a 2  s .  c o  m*/
        try {
            if (LogUtil.isLoggable(Log.DEBUG)) {
                LogUtil.d("Trying to bind to @" + address);
            }
            return new LocalServerSocket(address);
        } catch (BindException be) {
            LogUtil.w(be, "Binding error, sleep " + TIME_BETWEEN_BIND_RETRIES_MS + " ms...");
            if (firstException == null) {
                firstException = be;
            }
            Util.sleepUninterruptibly(TIME_BETWEEN_BIND_RETRIES_MS);
        }
    } while (retries-- > 0);

    throw firstException;
}

From source file:de.madvertise.android.sdk.MadvertiseUtil.java

/**
 * Returns the madvertise token/*from  w ww.  j  ava2  s . c  o m*/
 * 
 * @param context
 *            application context
 * @return madvertise_token from AndroidManifest.xml or null
 */
public static String getToken(final Context context, MadvertiseViewCallbackListener listener) {
    String madvertiseToken = null;

    PackageManager packageManager = context.getPackageManager();
    try {
        ApplicationInfo applicationInfo = packageManager.getApplicationInfo(context.getPackageName(),
                PackageManager.GET_META_DATA);
        madvertiseToken = applicationInfo.metaData.getString(MADVERTISE_SITE_TOKEN);
    } catch (Exception e) {
        e.printStackTrace();
    }

    if (madvertiseToken == null) {
        MadvertiseUtil.logMessage(null, Log.DEBUG,
                "Could not fetch \"madvertise_site_token\" from AndroidManifest.xml");
        if (listener != null) {
            listener.onError(new IllegalArgumentException(
                    "Could not fetch \"madvertise_site_token\" from AndroidManifest.xml"));
        }
    }

    return madvertiseToken;
}

From source file:de.madvertise.android.sdk.MadView.java

private void showStaticBannerView() {
    MadUtil.logMessage(null, Log.DEBUG, "Add static banner");

    Bitmap bannerBitmap = BitmapFactory.decodeByteArray(currentAd.getImageByteArray(), 0,
            currentAd.getImageByteArray().length);
    StaticBannerView staticBannerView = new StaticBannerView(getContext(), bannerBitmap);

    removeAllViews();// w w  w.j  a  v  a 2  s  .  c  o  m
    addView(staticBannerView);
}

From source file:com.android.car.trust.CarEnrolmentActivity.java

@Override
public void onResume() {
    super.onResume();

    if (!mPrefs.contains(SP_HANDLE_KEY)) {
        appendOutputText("No handles found.");
        return;/* www  .  j  ava 2s .  c  o m*/
    }

    try {
        mHandle = mPrefs.getLong(SP_HANDLE_KEY, -1);
        if (Log.isLoggable(TAG, Log.DEBUG)) {
            Log.d(TAG, "onResume, checking handle active: " + mHandle);
        }
        isTokenActive(mHandle);
    } catch (RemoteException e) {
        Log.e(TAG, "Error checking if token is valid");
        appendOutputText("Error checking if token is valid");
    }
}

From source file:de.madvertise.android.sdk.MadvertiseAd.java

/**
 * Handles the click action (opens the click url)
 *///from ww w .j  a  v  a  2s  . c o  m
protected void handleClick() {
    if (mClickUrl != null && !mClickUrl.equals("")) {
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(mClickUrl));
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        try {
            mContext.startActivity(intent);
            if (mCallbackListener != null) {
                mCallbackListener.onAdClicked();
            }
        } catch (Exception e) {
            MadvertiseUtil.logMessage(null, Log.DEBUG, "Failed to open URL : " + mClickUrl);
            if (mCallbackListener != null) {
                mCallbackListener.onError(e);
            }
            e.printStackTrace();
        }
    }
}

From source file:com.hyung.jin.seo.getup.wear.G3tUpActivity.java

@Override
protected void onResume() {
    super.onResume();

    // update threshold
    setUpThreshold();/*from  ww w. ja v a2s  .c om*/

    if (sensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_NORMAL)) {
        if (Log.isLoggable(G3tUpConstants.TAG, Log.DEBUG)) {
            Log.d(G3tUpConstants.TAG, "Successfully registered for the sensor updates");
        }
    }
}

From source file:com.radicaldynamic.groupinform.services.DatabaseService.java

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    if (Collect.Log.DEBUG)
        Log.d(Collect.LOGTAG, t + "received start ID " + startId + ": " + intent);
    return START_STICKY;
}

From source file:de.madvertise.android.sdk.MadvertiseView.java

/**
 * Constructor//from  w w w . java  2s  .  c  o m
 *
 * @param context
 * @param attrs
 */
public MadvertiseView(final Context context, final AttributeSet attrs) {
    super(context, attrs);

    MadvertiseUtil.logMessage(null, Log.DEBUG, "** Constructor for mad view called **");

    // We use GONE instead of INVISIBLE because GONE doesn't allocate space
    // in
    // the layout.
    setVisibility(GONE);

    if (!MadvertiseUtil.checkPermissionGranted(android.Manifest.permission.INTERNET, context)) {
        MadvertiseUtil.logMessage(null, Log.DEBUG, " *** ----------------------------- *** ");
        MadvertiseUtil.logMessage(null, Log.DEBUG, " *** Missing internet permissions! *** ");
        MadvertiseUtil.logMessage(null, Log.DEBUG, " *** ----------------------------- *** ");
        throw new IllegalArgumentException("Missing internet permission!");
    }

    if (!MadvertiseUtil.checkForBrowserDeclaration(getContext())) {
        MadvertiseUtil.logMessage(null, Log.DEBUG, " *** ----------------------------- *** ");
        MadvertiseUtil.logMessage(null, Log.DEBUG,
                " *** You must declare the activity de.madvertise.android.sdk.MadvertiseActivity in your manifest! *** ");
        MadvertiseUtil.logMessage(null, Log.DEBUG, " *** ----------------------------- *** ");
        throw new IllegalArgumentException("Missing Activity declaration!");
    }

    initParameters(attrs);

    final DisplayMetrics displayMetrics = context.getApplicationContext().getResources().getDisplayMetrics();
    MadvertiseUtil.logMessage(null, Log.DEBUG, "Display values: Width = " + displayMetrics.widthPixels
            + " ; Height = " + displayMetrics.heightPixels);

    mInitialBackground = this.getBackground();
    if (sTextBannerBackground == null) {
        Rect r = new Rect(0, 0, 1, displayMetrics.heightPixels);
        sTextBannerBackground = generateBackgroundDrawable(r, mBackgroundColor, 0xffffff);
    }

    setClickable(true);
    setFocusable(true);
    setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);

    if (mRequestThread == null || !mRequestThread.isAlive()) {
        requestNewAd(false);
    }

    // no reloads for ads with banner_type = rich_media
    if (mBannerType.contains(MadvertiseUtil.BANNER_TYPE_RICH_MEDIA)
            || mBannerType.contains(MadvertiseUtil.BANNER_TYPE_RICH_MEDIA_SHORT)) {
        this.setFetchingAdsEnabled(false);
        MadvertiseUtil.logMessage(null, Log.DEBUG,
                "No ad reloading, since banner_type=[rich_media|rm] was requested");
    }

    // just some testing
    // MadvertiseUtil.getPackages(context.getApplicationContext());

}

From source file:com.hyung.jin.seo.getup.wear.G3tUpActivity.java

@Override
protected void onPause() {
    super.onPause();
    sensorManager.unregisterListener(this);
    if (Log.isLoggable(G3tUpConstants.TAG, Log.DEBUG)) {
        Log.d(G3tUpConstants.TAG, "Unregistered for sensor events");
    }/* w  ww .  ja  v  a 2  s. co  m*/
}