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:de.madvertise.android.sdk.MadvertiseView.java
/** * Reads all parameters, not needed for a request to the ad server (colors, * refresh timeout, ...)//from w w w . j a v a 2 s.c om * * @param attrs attribute set for the view */ private void initParameters(final AttributeSet attrs) { mDp = getContext().getApplicationContext().getResources().getDisplayMetrics().density; if (attrs != null) { String packageName = "http://schemas.android.com/apk/res/" + getContext().getApplicationContext().getPackageName(); if (packageName != null) { MadvertiseUtil.logMessage(null, Log.DEBUG, "namespace = " + packageName); } mTestMode = attrs.getAttributeBooleanValue(packageName, "isTestMode", IS_TESTMODE_DEFAULT); mTextColor = attrs.getAttributeIntValue(packageName, "textColor", MadvertiseUtil.TEXT_COLOR_DEFAULT); mBackgroundColor = attrs.getAttributeIntValue(packageName, "backgroundColor", MadvertiseUtil.BACKGROUND_COLOR_DEFAULT); mSecondsToRefreshAd = attrs.getAttributeIntValue(packageName, "secondsToRefresh", MadvertiseUtil.SECONDS_TO_REFRESH_AD_DEFAULT); if (attrs.getAttributeValue(packageName, "bannerType") != null) { mBannerType = attrs.getAttributeValue(packageName, "bannerType"); } if (attrs.getAttributeValue(packageName, "animation") != null) { mAnimationType = attrs.getAttributeValue(packageName, "animation"); } mDeliverOnlyText = attrs.getAttributeBooleanValue(packageName, "deliverOnlyText", MadvertiseUtil.DELIVER_ONLY_TEXT_DEFAULT); if (!mBannerType.equals(MadvertiseUtil.BANNER_TYPE_MMA) && mDeliverOnlyText) { MadvertiseUtil.logMessage(null, Log.DEBUG, "Only banners in mma-format can show text. Setting deliferOnlyText to false."); mDeliverOnlyText = false; } mTextSize = attrs.getAttributeIntValue(packageName, "textSize", MadvertiseUtil.TEXT_SIZE_DEFAULT); if (mTextSize > 20) { MadvertiseUtil.logMessage(null, Log.DEBUG, "The text size must be set to 20 at maximum."); mTextSize = 20; } else if (mTextSize < 10) { MadvertiseUtil.logMessage(null, Log.DEBUG, "The text size must be set to 10 at minimum."); mTextSize = 10; } mIsMraid = attrs.getAttributeBooleanValue(packageName, "mraid", true); final String placementTypeStr = attrs.getAttributeValue(packageName, "placement_type"); if (placementTypeStr != null && placementTypeStr.equalsIgnoreCase("inline")) { mPlacementType = MadvertiseUtil.PLACEMENT_TYPE_INLINE; } else if (placementTypeStr != null && placementTypeStr.equalsIgnoreCase("interstitial")) { mPlacementType = MadvertiseUtil.PLACEMENT_TYPE_INTERSTITIAL; } } else { MadvertiseUtil.logMessage(null, Log.DEBUG, "AttributeSet is null. Using default parameters"); } if (mSecondsToRefreshAd != 0 && mSecondsToRefreshAd < 30) { mSecondsToRefreshAd = MadvertiseUtil.SECONDS_TO_REFRESH_AD_DEFAULT; MadvertiseUtil.logMessage(null, Log.DEBUG, "Refresh intervall must be higher than 60"); } calculateBannerDimensions(); MadvertiseUtil.logMessage(null, Log.DEBUG, "Using following attributes values:"); MadvertiseUtil.logMessage(null, Log.DEBUG, " testMode = " + mTestMode); MadvertiseUtil.logMessage(null, Log.DEBUG, " textColor = " + mTextColor); MadvertiseUtil.logMessage(null, Log.DEBUG, " backgroundColor = " + mBackgroundColor); MadvertiseUtil.logMessage(null, Log.DEBUG, " secondsToRefreshAd = " + mSecondsToRefreshAd); MadvertiseUtil.logMessage(null, Log.DEBUG, " bannerType = " + mBannerType); MadvertiseUtil.logMessage(null, Log.DEBUG, " animationType = " + mAnimationType); MadvertiseUtil.logMessage(null, Log.DEBUG, " deliverOnlyText = " + mDeliverOnlyText); MadvertiseUtil.logMessage(null, Log.DEBUG, " textSize = " + mTextSize); MadvertiseUtil.logMessage(null, Log.DEBUG, " isMraid = " + mIsMraid); MadvertiseUtil.logMessage(null, Log.DEBUG, " placementType = " + mPlacementType); MadvertiseUtil.logMessage(null, Log.DEBUG, " bannerWidth = " + mBannerWidth); MadvertiseUtil.logMessage(null, Log.DEBUG, " bannerHeight = " + mBannerHeight); MadvertiseUtil.logMessage(null, Log.DEBUG, " bannerWidthDp = " + mBannerWidthDp); MadvertiseUtil.logMessage(null, Log.DEBUG, " bannerHeightDp = " + mBannerHeightDp); }
From source file:com.radicaldynamic.groupinform.services.InformOnlineService.java
private void restoreSession() { // Restore any serialized session information File sessionCache = new File(getCacheDir(), FileUtilsExtended.SESSION_CACHE_FILE); if (sessionCache.exists()) { if (Collect.Log.DEBUG) Log.d(Collect.LOGTAG, t + "restoring cached session"); try {//from ww w. j av a 2 s. c o m InformOnlineSession session = new InformOnlineSession(); FileInputStream fis = new FileInputStream(sessionCache); ObjectInputStream ois = new ObjectInputStream(fis); session = (InformOnlineSession) ois.readObject(); ois.close(); fis.close(); Collect.getInstance().getInformOnlineState().setSession(new BasicCookieStore()); Iterator<InformOnlineSession> cookies = session.getCookies().iterator(); if (cookies.hasNext()) { InformOnlineSession ios = cookies.next(); BasicClientCookie bcc = new BasicClientCookie(ios.getName(), ios.getValue()); bcc.setDomain(ios.getDomain()); bcc.setExpiryDate(ios.getExpiryDate()); bcc.setPath(ios.getPath()); bcc.setVersion(ios.getVersion()); Collect.getInstance().getInformOnlineState().getSession().addCookie(bcc); } } catch (Exception e) { if (Collect.Log.WARN) Log.w(Collect.LOGTAG, t + "problem restoring cached session " + e.toString()); e.printStackTrace(); // Don't leave a broken file hanging new File(getCacheDir(), FileUtilsExtended.SESSION_CACHE_FILE).delete(); // Clear the session Collect.getInstance().getInformOnlineState().setSession(null); } } else { if (Collect.Log.DEBUG) Log.d(Collect.LOGTAG, t + "no session to restore"); } }
From source file:com.popdeem.sdk.core.utils.PDSocialUtils.java
public static TwitterConfig getTwitterKitForFabric(Context context) { TwitterAuthConfig twitterAuthConfig = getTwitterAuthConfig(context); if (twitterAuthConfig != null) { TwitterConfig twitterConfig = new TwitterConfig.Builder(context).logger(new DefaultLogger(Log.DEBUG)) .twitterAuthConfig(twitterAuthConfig).debug(true).build(); return twitterConfig; }/*from ww w. j ava 2s . co m*/ return null; }
From source file:com.radicaldynamic.groupinform.activities.LauncherActivity.java
@Override protected void onResume() { super.onResume(); final String tt = t + "onResume(): "; if (Collect.getInstance().getIoService() == null) { if (bindService(new Intent(LauncherActivity.this, InformOnlineService.class), mOnlineConnection, Context.BIND_AUTO_CREATE)) { if (Collect.Log.DEBUG) Log.d(Collect.LOGTAG, tt + "bound to InformOnlineService"); }/* w ww.j a va 2s . com*/ } if (Collect.getInstance().getDbService() == null) { if (bindService(new Intent(LauncherActivity.this, DatabaseService.class), mDatabaseConnection, Context.BIND_AUTO_CREATE)) { if (Collect.Log.DEBUG) Log.d(Collect.LOGTAG, tt + "bound to DatabaseService"); } } }
From source file:com.example.jumpnote.android.SyncAdapter.java
public List<ModelJava.Note> getLocallyChangedNotes(ContentProviderClient provider, Account account, Date sinceDate) throws RemoteException { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Getting local notes changed since " + Long.toString(sinceDate.getTime())); }//from ww w . ja v a 2 s . c om Cursor notesCursor = provider.query(JumpNoteContract.buildNoteListUri(account.name), PROJECTION, JumpNoteContract.Notes.MODIFIED_DATE + " > ?", new String[] { Long.toString(sinceDate.getTime()) }, null); List<ModelJava.Note> locallyChangedNotes = new ArrayList<ModelJava.Note>(); while (notesCursor.moveToNext()) { ContentValues values = new ContentValues(); DatabaseUtils.cursorRowToContentValues(notesCursor, values); ModelJava.Note changedNote = new ModelJava.Note(values); locallyChangedNotes.add(changedNote); } notesCursor.close(); return locallyChangedNotes; }
From source file:KSView.PercentLayoutHelper.java
/** * Iterates over children and restores their original dimensions that were changed for * percentage values. Calling this method only makes sense if you previously called * {@link PercentLayoutHelper#adjustChildren(int, int)}. */// ww w. ja v a 2 s .c o m public void restoreOriginalParams() { 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)) { LogUtil.d(TAG, "should restore " + view + " " + params); } if (params instanceof PercentLayoutParams) { PercentLayoutInfo info = ((PercentLayoutParams) params).getPercentLayoutInfo(); if (Log.isLoggable(TAG, Log.DEBUG)) { LogUtil.d(TAG, "using " + info); } if (info != null) { if (params instanceof ViewGroup.MarginLayoutParams) { info.restoreMarginLayoutParams((ViewGroup.MarginLayoutParams) params); } else { info.restoreLayoutParams(params); } } } } }
From source file:io.requery.android.database.sqlite.SQLiteQueryBuilder.java
/** * Perform a query by combining all current settings and the * information passed into this method.//from w w w . j a v a2 s. c o m * * @param db the database to query on * @param projectionIn A list of which columns to return. Passing * null will return all columns, which is discouraged to prevent * reading data from storage that isn't going to be used. * @param selection A filter declaring which rows to return, * formatted as an SQL WHERE clause (excluding the WHERE * itself). Passing null will return all rows for the given URL. * @param selectionArgs You may include ?s in selection, which * will be replaced by the values from selectionArgs, in order * that they appear in the selection. The values will be bound * as Strings. * @param groupBy A filter declaring how to group rows, formatted * as an SQL GROUP BY clause (excluding the GROUP BY * itself). Passing null will cause the rows to not be grouped. * @param having A filter declare which row groups to include in * the cursor, if row grouping is being used, formatted as an * SQL HAVING clause (excluding the HAVING itself). Passing * null will cause all row groups to be included, and is * required when row grouping is not being used. * @param sortOrder How to order the rows, formatted as an SQL * ORDER BY clause (excluding the ORDER BY itself). Passing null * will use the default sort order, which may be unordered. * @param limit Limits the number of rows returned by the query, * formatted as LIMIT clause. Passing null denotes no LIMIT clause. * @param cancellationSignal A signal to cancel the operation in progress, or null if none. * If the operation is canceled, then {@link OperationCanceledException} will be thrown * when the query is executed. * @return a cursor over the result set * @see android.content.ContentResolver#query(android.net.Uri, String[], * String, String[], String) */ public Cursor query(SQLiteDatabase db, String[] projectionIn, String selection, String[] selectionArgs, String groupBy, String having, String sortOrder, String limit, CancellationSignal cancellationSignal) { if (mTables == null) { return null; } if (mStrict && selection != null && selection.length() > 0) { // Validate the user-supplied selection to detect syntactic anomalies // in the selection string that could indicate a SQL injection attempt. // The idea is to ensure that the selection clause is a valid SQL expression // by compiling it twice: once wrapped in parentheses and once as // originally specified. An attacker cannot create an expression that // would escape the SQL expression while maintaining balanced parentheses // in both the wrapped and original forms. String sqlForValidation = buildQuery(projectionIn, "(" + selection + ")", groupBy, having, sortOrder, limit); validateQuerySql(db, sqlForValidation, cancellationSignal); // will throw if query is invalid } String sql = buildQuery(projectionIn, selection, groupBy, having, sortOrder, limit); if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Performing query: " + sql); } return db.rawQueryWithFactory(mFactory, sql, selectionArgs, SQLiteDatabase.findEditTable(mTables), cancellationSignal); // will throw if query is invalid }
From source file:com.samsung.android.remindme.SyncAdapter.java
public List<ModelJava.Alert> getLocallyChangedAlerts(ContentProviderClient provider, Account account, Date sinceDate) throws RemoteException { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Getting local alerts changed since " + Long.toString(sinceDate.getTime())); }/*from w w w . ja v a 2 s. co m*/ Cursor alertsCursor = provider.query(RemindMeContract.buildAlertListUri(account.name), PROJECTION, RemindMeContract.Alerts.MODIFIED_DATE + " > ?", new String[] { Long.toString(sinceDate.getTime()) }, null); List<ModelJava.Alert> locallyChangedAlerts = new ArrayList<ModelJava.Alert>(); while (alertsCursor.moveToNext()) { ContentValues values = new ContentValues(); DatabaseUtils.cursorRowToContentValues(alertsCursor, values); ModelJava.Alert changedAlert = new ModelJava.Alert(values); locallyChangedAlerts.add(changedAlert); } alertsCursor.close(); return locallyChangedAlerts; }
From source file:com.samsung.richnotification.RichNotification.java
@Override //On RichNotification Read in the gear public void onRead(UUID arg0) { if (mCallbackContext == null) return;/*w w w . j av a 2 s . co m*/ try { JSONObject eventMsg = new JSONObject(); eventMsg.put("returnType", RichNotificationHelper.RETURN_TYPE_NOTIFICATION_READ); eventMsg.put("returnValue", arg0.toString()); PluginResult sentResult = new PluginResult(PluginResult.Status.OK, eventMsg); sentResult.setKeepCallback(true); mCallbackContext.sendPluginResult(sentResult); } catch (JSONException jse) { if (Log.isLoggable(RICHNOTI, Log.DEBUG)) Log.d(TAG, "Gear input invalid"); return; } }
From source file:com.radicaldynamic.groupinform.services.DatabaseService.java
synchronized private void connectToRemoteServer() throws DbUnavailableException { final String tt = t + "connectToRemoteServer(): "; String host = getString(R.string.tf_default_ionline_server); int port = 6984; if (Collect.Log.DEBUG) Log.d(Collect.LOGTAG, tt + "establishing connection to " + host + ":" + port); try {/* ww w .j a v a2 s. c om*/ mRemoteHttpClient = new StdHttpClient.Builder().enableSSL(true).host(host).port(port) .socketTimeout(30 * 1000).username(Collect.getInstance().getInformOnlineState().getDeviceId()) .password(Collect.getInstance().getInformOnlineState().getDeviceKey()).build(); mRemoteDbInstance = new StdCouchDbInstance(mRemoteHttpClient); mRemoteDbInstance.getAllDatabases(); if (mConnectedToRemote == false) mConnectedToRemote = true; if (Collect.Log.DEBUG) Log.d(Collect.LOGTAG, tt + "connection to " + host + " successful"); } catch (Exception e) { if (Collect.Log.ERROR) Log.e(Collect.LOGTAG, tt + "while connecting to server " + port + ": " + e.toString()); e.printStackTrace(); mConnectedToRemote = false; throw new DbUnavailableException(); } }