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:net.micode.fileexplorer.ServerControlActivity.java

public void onPause() {
    super.onPause();
    UiUpdater.unregisterClient(handler);
    myLog.l(Log.DEBUG, "Unregistered for wifi updates");
    mActivity.unregisterReceiver(wifiReceiver);
}

From source file:com.example.android.jumpingjack.MainActivity.java

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

From source file:com.samsung.richnotification.RichNotification.java

/**
 * Checks if the device supports RichNotification feature.
 *
 * @param callbackContext// w w  w  .j av a  2s  .c om
 *            The callback id used when calling back into JavaScript.
 * @return true if the RichNotification is supported or false if not supported.
 *
 */
private boolean isRichNotificationSupported(CallbackContext callbackContext) {
    if (mIsRichSupported)
        return true;

    if (Log.isLoggable(RICHNOTI, Log.DEBUG))
        Log.d(TAG, "Checking RichNotification support...");
    Srn srn = new Srn();
    try {
        // Initialize an instance of Srn.
        srn.initialize(mContext);
    } catch (SsdkUnsupportedException e) {
        // Error handling
        if (e.getType() == SsdkUnsupportedException.VENDOR_NOT_SUPPORTED) {
            Log.e(TAG, "Initialization error. Vendor is not Samsung.");
            callbackContext.error(RichNotificationHelper.VENDOR_NOT_SUPPORTED);
        } else if (e.getType() == SsdkUnsupportedException.DEVICE_NOT_SUPPORTED) {
            Log.e(TAG, "Initialization error. Device not supported.");
            callbackContext.error(RichNotificationHelper.DEVICE_NOT_SUPPORTED);
        } else if (e.getType() == SsdkUnsupportedException.LIBRARY_NOT_INSTALLED) {
            Log.e(TAG, "Initialization error. Device not supported.");
            callbackContext.error(RichNotificationHelper.LIBRARY_NOT_INSTALLED);
        } else if (e.getType() == SsdkUnsupportedException.LIBRARY_UPDATE_IS_RECOMMENDED) {
            Log.e(TAG, "Initialization error. Device not supported.");
            callbackContext.error(RichNotificationHelper.LIBRARY_UPDATE_IS_RECOMMENDED);
        } else if (e.getType() == SsdkUnsupportedException.LIBRARY_UPDATE_IS_REQUIRED) {
            Log.e(TAG, "Initialization error. Device not supported.");
            callbackContext.error(RichNotificationHelper.LIBRARY_UPDATE_IS_REQUIRED);
        } else {
            Log.e(TAG, "Initialization error.");
            callbackContext.error("Initialization error");
        }
        return false;
    }
    mIsRichSupported = true;
    return true;
}

From source file:com.abajeli.wearable.gesturecadabra.MainActivity.java

@Override
protected void onResume() {
    super.onResume();
    if (mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL)) {
        if (Log.isLoggable(TAG, Log.DEBUG)) {
            Log.d(TAG, "Successfully registered for the sensor updates");
        }//from w w  w. j  a va2  s. c o m
    }
}

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

@Override
public boolean onTouchEvent(MotionEvent event) {
    MadUtil.logMessage(null, Log.DEBUG, "onTouchEvent(MotionEvent event) fired");
    if (currentAd != null)
        currentAd.handleClick();/*from  w  ww  .  j av  a  2  s  .  c o  m*/
    return true;
}

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

public MadvertiseMraidView(Context context) {
    super(context);
    setVerticalScrollBarEnabled(false);/*from  www .  j  a  va2  s.c  om*/
    setHorizontalScrollBarEnabled(false);
    setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
    setBackgroundColor(Color.TRANSPARENT);
    WebSettings settings = getSettings();
    settings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
    settings.setJavaScriptEnabled(true);
    //settings.setPluginsEnabled(true);

    // Initialize the default expand properties.
    DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
    mExpandProperties = new ExpandProperties(metrics.widthPixels, metrics.heightPixels);
    MadvertiseUtil.logMessage(null, Log.INFO,
            "Setting default expandProperties : " + mExpandProperties.toJson().toString());

    // This bridge stays available until this view is destroyed, hence no
    // reloading when displaying new ads is necessary.
    addJavascriptInterface(mBridge, "mraid_bridge");

    setWebViewClient(new WebViewClient() {
        private boolean mError = false;

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, final String url) {
            post(new Runnable() {
                @Override
                public void run() {
                    if (mListener != null) {
                        mListener.onAdClicked();
                    }
                    final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url),
                            getContext().getApplicationContext(), MadvertiseActivity.class);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    getContext().startActivity(intent);
                }
            });
            return true;
        }

        @Override
        public void onPageFinished(WebView view, String url) {
            super.onPageFinished(view, url);
            if (!url.endsWith("mraid.js") && !mError) {
                MadvertiseUtil.logMessage(null, Log.DEBUG, "Setting mraid to default");
                checkReady();

                // Close button in default size for interstitial ads
                if (mPlacementType == MadvertiseUtil.PLACEMENT_TYPE_INTERSTITIAL) {
                    mCloseButton = addCloseButtonToViewGroup(((ViewGroup) getParent()));
                    mCloseButton.setImageResource(android.R.drawable.ic_menu_close_clear_cancel);
                }
            }
        }

        @Override
        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
            super.onReceivedError(view, errorCode, description, failingUrl);
            mError = true;
        }
    });

    // Comment this in to enable video tag-capability.
    this.setWebChromeClient(new WebChromeClient() {

        @Override
        public void onShowCustomView(View view, CustomViewCallback callback) {
            MadvertiseUtil.logMessage(null, Log.INFO, "showing VideoView");
            super.onShowCustomView(view, callback);
            if (view instanceof FrameLayout) {
                FrameLayout frame = (FrameLayout) view;
                if (frame.getFocusedChild() instanceof VideoView) {
                    mVideo = (VideoView) ((FrameLayout) view).getFocusedChild();
                    frame.removeView(mVideo);
                    ((ViewGroup) getParent()).addView(mVideo);

                    // Will also be called onError
                    mVideo.setOnCompletionListener(new OnCompletionListener() {

                        @Override
                        public void onCompletion(MediaPlayer player) {
                            player.stop();
                        }
                    });

                    mVideo.setOnErrorListener(new OnErrorListener() {

                        @Override
                        public boolean onError(MediaPlayer mp, int what, int extra) {
                            MadvertiseUtil.logMessage(null, Log.WARN, "Error while playing video");

                            if (mListener != null) {
                                mListener.onError(new IOException("Error while playing video"));
                            }

                            // We return false in order to call
                            // onCompletion()
                            return false;
                        }
                    });

                    mVideo.start();
                }
            }
        }

        @Override
        public void onHideCustomView() {
            if (mVideo != null) {
                ((ViewGroup) getParent()).removeView(mVideo);
                if (mVideo.isPlaying()) {
                    mVideo.stopPlayback();
                }
            }
        }
    });
}

From source file:com.binomed.showtime.android.util.localisation.LocationUtils.java

public static void registerLocalisationListener(final Context context, final ProviderEnum provider,
        final LocalisationManagement listener) {
    switch (provider) {
    case GPS_PROVIDER:
    case GSM_PROVIDER: {
        if (isLocalisationEnabled(context, provider)) {
            LocationManager locationManager = getLocationManager(context);
            if (locationManager != null) {
                locationManager.requestLocationUpdates(provider.getAndroidProvider(), 10000, 10, listener);
            } else {
                if (Log.isLoggable(TAG, Log.DEBUG)) {
                    Log.d(TAG, "No listener Put"); //$NON-NLS-1$
                    listener.onProviderDisabled(null);
                }// ww w .  j  a v a 2s . c  o  m
            }
        } else {
            listener.onProviderDisabled(null);
        }
        break;
    }
    case IP_PROVIDER:
    case WIFI_PROVIDER:
    case XPS_PROVIDER: {
        final XPS xps = listener.getXps();
        final WPSAuthentication auth = listener.getWpsAuth();
        xps.registerUser(auth, null, new RegistrationCallback() {

            @Override
            public WPSContinuation handleError(WPSReturnCode error) {
                switch (error) {
                case WPS_ERROR_LOCATION_CANNOT_BE_DETERMINED: {
                    Log.e(TAG, error.toString());
                    break;
                }
                case WPS_ERROR_WIFI_NOT_AVAILABLE: {
                    Log.e(TAG, error.toString());
                    break;
                }
                case WPS_ERROR_SERVER_UNAVAILABLE: {
                    Log.e(TAG, error.toString());
                    break;
                }
                case WPS_ERROR_NO_WIFI_IN_RANGE: {
                    Log.e(TAG, error.toString());

                    break;
                }
                case WPS_ERROR: {
                    Log.e(TAG, error.name());

                    break;
                }
                default:
                    Log.e(TAG, error.name());
                    break;
                }
                // TODO grer les cas d'erreur
                // in all case, we'll stop
                return WPSContinuation.WPS_STOP;
            }

            @Override
            public void done() {
                Log.i(TAG, "Registration Done ! ");

            }

            @Override
            public void handleSuccess() {

                switch (provider) {
                case IP_PROVIDER: {
                    xps.getIPLocation(auth //
                    , WPSStreetAddressLookup.WPS_LIMITED_STREET_ADDRESS_LOOKUP //
                    , listener//
                    );
                    break;
                }
                case WIFI_PROVIDER: {
                    xps.getLocation(auth //
                    , WPSStreetAddressLookup.WPS_LIMITED_STREET_ADDRESS_LOOKUP //
                    , listener//
                    );
                    break;
                }
                case XPS_PROVIDER: {
                    xps.getXPSLocation(auth //
                    , (5000 / 1000) //
                    , 30 //
                    , listener//
                    );

                }
                default:
                    break;
                }
            }
        });
        break;
    }
    default:
        break;
    }
}

From source file:com.samsung.spen.SpenPlugin.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    super.onActivityResult(requestCode, resultCode, intent);
    if (Log.isLoggable(Utils.SPEN, Log.DEBUG)) {
        Log.d(TAG, "Inside onActivityResult");
        Log.d(TAG, "Intent: " + intent + ", requestCode: " + requestCode);
    }//from   w  w w.  j av  a  2  s  . c om
    if (requestCode == Utils.REQUEST_CODE_SELECT_IMAGE_BACKGROUND) {
        if (Log.isLoggable(Utils.SPEN, Log.DEBUG)) {
            Log.d(TAG, "on background image selected");
        }
        if (mCurrentSurfaceType == Utils.SURFACE_INLINE) {
            mSpenSurfaceViews.getSurfaceView(mCurrentWorkingId).setasBgImage(intent);
        } else {
            Message msgObj = setBgHandler.obtainMessage();
            Bundle b = new Bundle();
            b.putParcelable("intent", intent);
            msgObj.setData(b);
            setBgHandler.sendMessage(msgObj);
        }
    } else {
        if (Log.isLoggable(Utils.SPEN, Log.DEBUG)) {
            Log.d(TAG, "request code is not matching");
        }
    }
}

From source file:android.percent.support.PercentLayoutHelper.java

/**
 * Iterates over children and changes their width and height to one calculated from percentage
 * values./*from ww w  .j  ava 2  s  .c o m*/
 *
 * @param widthMeasureSpec  Width MeasureSpec of the parent ViewGroup.
 * @param heightMeasureSpec Height MeasureSpec of the parent ViewGroup.
 */
public void adjustChildren(int widthMeasureSpec, int heightMeasureSpec) {
    if (Log.isLoggable(TAG, Log.DEBUG)) {
        Log.d(TAG,
                "adjustChildren: " + mHost + " widthMeasureSpec: " + View.MeasureSpec.toString(widthMeasureSpec)
                        + " heightMeasureSpec: " + View.MeasureSpec.toString(heightMeasureSpec));
    }
    int widthHint = View.MeasureSpec.getSize(widthMeasureSpec);
    int heightHint = View.MeasureSpec.getSize(heightMeasureSpec);

    if (Log.isLoggable(TAG, Log.DEBUG))
        Log.d(TAG, "widthHint = " + widthHint + " , heightHint = " + heightHint);

    for (int i = 0, N = mHost.getChildCount(); i < N; i++) {
        View view = mHost.getChildAt(i);
        ViewGroup.LayoutParams params = view.getLayoutParams();

        if (Log.isLoggable(TAG, Log.DEBUG)) {
            Log.d(TAG, "should adjust " + view + " " + params);
        }

        if (params instanceof PercentLayoutParams) {
            PercentLayoutInfo info = ((PercentLayoutParams) params).getPercentLayoutInfo();
            if (Log.isLoggable(TAG, Log.DEBUG)) {
                Log.d(TAG, "using " + info);
            }
            if (info != null) {
                supportTextSize(widthHint, heightHint, view, info);
                supportPadding(widthHint, heightHint, view, info);
                supportMinOrMaxDimesion(widthHint, heightHint, view, info);

                if (params instanceof ViewGroup.MarginLayoutParams) {
                    info.fillMarginLayoutParams((ViewGroup.MarginLayoutParams) params, widthHint, heightHint);
                } else {
                    info.fillLayoutParams(params, widthHint, heightHint);
                }
            }
        }
    }

}

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

@Override
public void onDestroy() {
    if (Log.isLoggable(TAG, Log.DEBUG)) {
        Log.d(TAG, "Car Trust agent shutting down");
    }//  w  w w . ja  v  a 2s  .c o  m
    mLocalBroadcastManager.unregisterReceiver(mTrustEventReceiver);

    // Unbind the service to avoid leaks from BLE stack.
    if (mBleServiceBound) {
        unbindService(mServiceConnection);
    }
    super.onDestroy();
}