List of usage examples for android.util Log DEBUG
int DEBUG
To view the source code for android.util Log DEBUG.
Click Source Link
From source file:com.android.calendar.month.MonthByWeekFragment.java
private void stopLoader() { synchronized (mUpdateLoader) { mHandler.removeCallbacks(mUpdateLoader); if (mLoader != null) { mLoader.stopLoading();/*from w w w. ja v a 2 s. c o m*/ if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Stopped loader from loading"); } } } }
From source file:de.madvertise.android.sdk.MadView.java
/** * Reads all parameters, not needed for a request to the ad server (colors, * refresh timeout, ...)// w w w . j ava2 s. c om * * @param attrs * attribute set for the view */ private void initParameters(AttributeSet attrs) { if (attrs != null) { String packageName = "http://schemas.android.com/apk/res/" + getContext().getPackageName(); if (packageName != null) { MadUtil.logMessage(null, Log.DEBUG, "namespace = " + packageName); } testMode = attrs.getAttributeBooleanValue(packageName, "isTestMode", IS_TESTMODE_DEFAULT); textColor = attrs.getAttributeIntValue(packageName, "textColor", MadUtil.TEXT_COLOR_DEFAULT); backgroundColor = attrs.getAttributeIntValue(packageName, "backgroundColor", MadUtil.BACKGROUND_COLOR_DEFAULT); secondsToRefreshAd = attrs.getAttributeIntValue(packageName, "secondsToRefresh", MadUtil.SECONDS_TO_REFRESH_AD_DEFAULT); bannerType = attrs.getAttributeValue(packageName, "bannerType"); if (bannerType == null) bannerType = MadUtil.BANNER_TYPE_DEFAULT; deliverOnlyText = attrs.getAttributeBooleanValue(packageName, "deliverOnlyText", MadUtil.DELIVER_ONLY_TEXT_DEFAULT); textSize = attrs.getAttributeIntValue(packageName, "textSize", MadUtil.TEXT_SIZE_DEFAULT); } else { MadUtil.logMessage(null, Log.DEBUG, "AttributeSet is null!"); } if (secondsToRefreshAd != 0 && secondsToRefreshAd < 60) secondsToRefreshAd = MadUtil.SECONDS_TO_REFRESH_AD_DEFAULT; if (bannerType.equals("iab")) bannerHeight = MadUtil.IAB_BANNER_HEIGHT_DEFAULT; MadUtil.logMessage(null, Log.DEBUG, "Using following attributes values:"); MadUtil.logMessage(null, Log.DEBUG, " testMode = " + testMode); MadUtil.logMessage(null, Log.DEBUG, " textColor = " + textColor); MadUtil.logMessage(null, Log.DEBUG, " backgroundColor = " + backgroundColor); MadUtil.logMessage(null, Log.DEBUG, " secondsToRefreshAd = " + secondsToRefreshAd); MadUtil.logMessage(null, Log.DEBUG, " bannerType = " + bannerType); MadUtil.logMessage(null, Log.DEBUG, " deliverOnlyText = " + deliverOnlyText); MadUtil.logMessage(null, Log.DEBUG, " textSize = " + textSize); MadUtil.logMessage(null, Log.DEBUG, " bannerHeight = " + bannerHeight); }
From source file:com.samsung.richnotification.RichNotification.java
/** * This function will send a new notification or will update the notification sent. * * @param data// ww w . j a v a 2 s . c o m * The JSONArray with parameters required for sending the notification. * @param callbackContext * The callback id used when calling back into JavaScript. * @return true if the notification is sent or false if the notification is not sent. * */ private boolean sendRichNotification(JSONArray data, CallbackContext callbackContext) throws JSONException { RichNotificationOptions options = null; SrnPrimaryTemplate primaryTemplate = null; SrnSecondaryTemplate secondaryTemplate = null; // This function takes care of error callbacks if (!initRichNotification(callbackContext)) { Log.e(TAG, "Initialization failed."); return false; } if (Log.isLoggable(RICHNOTI, Log.DEBUG)) Log.d(TAG, "Creating the notification."); // Fetch options from the data object options = new RichNotificationOptions(data); options.printLogs(); SrnRichNotification noti = null; UUID uuid = null; try { uuid = UUID.fromString(options.uuid); } catch (IllegalArgumentException invalidUUID) { Log.e(TAG, "Invalid UUID supplied. Creating a new notification."); options.uuid = null; } if (options.uuid == null) noti = new SrnRichNotification(mContext); else noti = new SrnRichNotification(mContext, uuid); // Set notification icon if (!options.notificationIcon.isEmpty()) { Bitmap notiIconBit = RichNotificationHelper.getIconBitmap(mContext, "file://" + options.notificationIcon); SrnImageAsset notiIconAsst = new SrnImageAsset(mContext, "notiIcon", notiIconBit); noti.setIcon(notiIconAsst); } noti.setAlertType(options.alertType, options.popupType); noti.setReadout(options.readoutTitle, options.readout); noti.setTitle(options.notificationTitle); primaryTemplate = RichNotificationHelper.createPrimaryTemplate(mContext, options); secondaryTemplate = RichNotificationHelper.createSecondaryTemplate(mContext, options); noti.setPrimaryTemplate(primaryTemplate); if (secondaryTemplate != null) noti.setSecondaryTemplate(secondaryTemplate); // Action related List<SrnAction> actionList = RichNotificationHelper.createActions(mContext, callbackContext, options); if (actionList != null) { noti.addActions(actionList); } else { if (Log.isLoggable(RICHNOTI, Log.DEBUG)) Log.d(TAG, "Actions not defined"); } try { options.uuid = mRichNotificationManager.notify(noti).toString(); JSONObject successMsg = new JSONObject(); successMsg.put("returnType", RichNotificationHelper.RETURN_TYPE_NOTIFICATION_SENT); successMsg.put("returnValue", options.uuid); if (Log.isLoggable(RICHNOTI, Log.DEBUG)) Log.d(TAG, "Notification sent. UUID: " + options.uuid); PluginResult sentResult = new PluginResult(PluginResult.Status.OK, successMsg); sentResult.setKeepCallback(true); callbackContext.sendPluginResult(sentResult); return true; } catch (SecurityException secEx) { Log.e(TAG, "Permission denied"); callbackContext.error(RichNotificationHelper.PERMISSION_DENIED); return false; } }
From source file:de.madvertise.android.sdk.MadvertiseView.java
@Override public boolean onTouchEvent(MotionEvent event) { MadvertiseUtil.logMessage(null, Log.DEBUG, "onTouchEvent(MotionEvent event) fired"); if (mCurrentAd != null) mCurrentAd.handleClick();/*from www . j a va2 s .c o m*/ return true; }
From source file:info.guardianproject.otr.app.im.app.AddContactActivity.java
void inviteBuddies() { Rfc822Token[] recipients = Rfc822Tokenizer.tokenize(mAddressList.getText()); try {//from w w w . ja v a 2s . c om IImConnection conn = mApp.getConnection(mProviderId); IContactList list = getContactList(conn); if (list == null) { // Log.e(ImApp.LOG_TAG, "<AddContactActivity> can't find given contact list:" // + getSelectedListName()); finish(); } else { boolean fail = false; String username = null; for (Rfc822Token recipient : recipients) { username = recipient.getAddress(); if (username.indexOf('@') == -1) { username = username + "@" + getDomain(mProviderId); } if (Log.isLoggable(ImApp.LOG_TAG, Log.DEBUG)) { log("addContact:" + username); } int res = list.addContact(username); if (res != ImErrorInfo.NO_ERROR) { fail = true; mHandler.showAlert(R.string.error, ErrorResUtils.getErrorRes(getResources(), res, username)); } } // close the screen if there's no error. if (!fail) { if (username != null) { Intent intent = new Intent(); intent.putExtra(ContactsPickerActivity.EXTRA_RESULT_USERNAME, username); intent.putExtra(ContactsPickerActivity.EXTRA_RESULT_PROVIDER, mProviderId); setResult(RESULT_OK, intent); finish(); } } } } catch (RemoteException ex) { Log.e(ImApp.LOG_TAG, "<AddContactActivity> inviteBuddies: caught " + ex); } }
From source file:com.icenler.lib.view.support.percentlayout.PercentLayoutHelper.java
private void invokeMethod(String methodName, int widthHint, int heightHint, View view, Class clazz, PercentLayoutInfo.PercentVal percentVal) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { if (Log.isLoggable(TAG, Log.DEBUG)) Log.d(TAG, methodName + " ==> " + percentVal); if (percentVal != null) { Method setMaxWidthMethod = clazz.getMethod(methodName, int.class); setMaxWidthMethod.setAccessible(true); int base = percentVal.isBaseWidth ? widthHint : heightHint; setMaxWidthMethod.invoke(view, (int) (base * percentVal.percent)); }/*from ww w. j a v a 2 s. c o m*/ }
From source file:com.binomed.showtime.android.util.localisation.LocationUtils.java
public static void unRegisterListener(Context context, ProviderEnum provider, LocalisationManagement listener) { switch (provider) { case GPS_PROVIDER: case GSM_PROVIDER: { LocationManager locationManager = getLocationManager(context); if (locationManager != null) { locationManager.removeUpdates(listener); } else {// w w w. j ava 2 s . c o m if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "No listener Put"); //$NON-NLS-1$ } } break; } case WIFI_PROVIDER: case XPS_PROVIDER: { XPS xps = listener.getXps(); if (xps != null) { xps.abort(); } break; } default: break; } }
From source file:de.madvertise.android.sdk.MadvertiseUtil.java
/** * Returns the MD5 hash for a string.// w w w . j a v a 2 s .c o m * * @param input * @return md5 hash */ public synchronized static String getHash(final String input, HashType hashType) { MessageDigest messageDigest = null; try { messageDigest = MessageDigest.getInstance(hashType.toString()); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); MadvertiseUtil.logMessage(null, Log.DEBUG, "Could not create hash value"); return ""; } messageDigest.update(input.getBytes()); String temp = null; byte[] digest = messageDigest.digest(); StringBuffer hexString = new StringBuffer(); for (int i = 0; i < digest.length; i++) { temp = Integer.toHexString(0xFF & digest[i]); if (temp.length() < 2) { temp = "0" + temp; } hexString.append(temp); } return hexString.toString(); }
From source file:com.android.mms.ui.ConversationListItem.java
public void onUpdate(Contact updated) { if (Log.isLoggable(LogTag.CONTACT, Log.DEBUG)) { Log.v(TAG, "onUpdate: " + this + " contact: " + updated); }/* w w w . j av a 2s . co m*/ mHandler.post(new Runnable() { public void run() { updateFromView(); } }); }
From source file:cm.confide.ex.chips.RecipientAlternatesAdapter.java
private static HashMap<String, RecipientEntry> processContactEntries(Cursor c) { HashMap<String, RecipientEntry> recipientEntries = new HashMap<String, RecipientEntry>(); if (c != null && c.moveToFirst()) { do {//from w w w .j a va 2 s .co m String address = c.getString(Queries.Query.DESTINATION); final RecipientEntry newRecipientEntry = RecipientEntry.constructTopLevelEntry( c.getString(Queries.Query.NAME), c.getInt(Queries.Query.DISPLAY_NAME_SOURCE), c.getString(Queries.Query.DESTINATION), c.getInt(Queries.Query.DESTINATION_TYPE), c.getString(Queries.Query.DESTINATION_LABEL), c.getLong(Queries.Query.CONTACT_ID), c.getLong(Queries.Query.DATA_ID), c.getString(Queries.Query.PHOTO_THUMBNAIL_URI), true, false /* isGalContact TODO(skennedy) We should look these up eventually */); /* * In certain situations, we may have two results for one address, where one of the * results is just the email address, and the other has a name and photo, so we want * to use the better one. */ final RecipientEntry recipientEntry = getBetterRecipient(recipientEntries.get(address), newRecipientEntry); recipientEntries.put(address, recipientEntry); if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Received reverse look up information for " + address + " RESULTS: " + " NAME : " + c.getString(Queries.Query.NAME) + " CONTACT ID : " + c.getLong(Queries.Query.CONTACT_ID) + " ADDRESS :" + c.getString(Queries.Query.DESTINATION)); } } while (c.moveToNext()); } return recipientEntries; }