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:android.percent.support.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 = getBaseByModeAndVal(widthHint, heightHint, percentVal.basemode); setMaxWidthMethod.invoke(view, (int) (base * percentVal.percent)); }// w ww . j a va2 s .c o m }
From source file:com.xorcode.andtweet.net.ConnectionOAuth.java
/** * Universal method for several Timelines... * // w w w . j a va 2s . c o m * @param url URL predefined for this timeline * @param sinceId * @param maxId * @param limit * @param page * @return * @throws ConnectionException */ private JSONArray getTimeline(String url, long sinceId, long maxId, int limit, int page) throws ConnectionException { setSinceId(sinceId); setLimit(limit); boolean ok = false; JSONArray jArr = null; try { Uri sUri = Uri.parse(url); Uri.Builder builder = sUri.buildUpon(); if (getSinceId() != 0) { builder.appendQueryParameter("since_id", String.valueOf(getSinceId())); } else if (maxId != 0) { // these are mutually exclusive builder.appendQueryParameter("max_id", String.valueOf(maxId)); } if (getLimit() != 0) { builder.appendQueryParameter("count", String.valueOf(getLimit())); } if (page != 0) { builder.appendQueryParameter("page", String.valueOf(page)); } HttpGet get = new HttpGet(builder.build().toString()); mConsumer.sign(get); String response = mClient.execute(get, new BasicResponseHandler()); jArr = new JSONArray(response); ok = (jArr != null); } catch (NullPointerException e) { // It looks like a bug in the library, but we have to catch it Log.e(TAG, "NullPointerException was caught, URL='" + url + "'"); e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); throw new ConnectionException(e.getLocalizedMessage()); } if (MyLog.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "getTimeline '" + url + "' " + (ok ? "OK, " + jArr.length() + " statuses" : "FAILED")); } return jArr; }
From source file:com.icenler.lib.view.support.percentlayout.PercentLayoutHelper.java
/** * Constructs a PercentLayoutInfo from attributes associated with a View. Call this method from * {@code LayoutParams(Context c, AttributeSet attrs)} constructor. *///from w ww . jav a 2s.c o m public static PercentLayoutInfo getPercentLayoutInfo(Context context, AttributeSet attrs) { PercentLayoutInfo info = null; TypedArray array = context.obtainStyledAttributes(attrs, com.zhy.android.percent.support.R.styleable.PercentLayout_Layout); info = setWidthAndHeightVal(array, info); info = setMarginRelatedVal(array, info); info = setTextSizeSupportVal(array, info); info = setMinMaxWidthHeightRelatedVal(array, info); info = setPaddingRelatedVal(array, info); Log.d(TAG, "constructed: " + info); array.recycle(); if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "constructed: " + info); } return info; }
From source file:com.infine.android.devoxx.service.RestService.java
private void loadRemoteData() throws HandlerException { final long startRemote = System.currentTimeMillis(); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mApplicationContext); // gestion des schedules int localScheduleVersion = prefs.getInt(PREFS_SCHEDULE_VERSION, 0); int lastScheduleVersion = VersionReader.getVersion(SERVER_PATH_SCHEDULE_VERSION); if (localScheduleVersion < lastScheduleVersion) { mRemoteExecutor.executeGet(SERVER_PATH_SCHEDULE, new JsonScheduleHandler(mApplicationContext, PREFS_SCHEDULE_VERSION, lastScheduleVersion)); }/*from ww w.j a va 2 s.co m*/ // gestion des sessions int localSessionVersion = prefs.getInt(PREFS_SESSION_VERSION, 0); int lastSessionVersion = VersionReader.getVersion(SERVER_PATH_SESSION_VERSION); if (localSessionVersion < lastSessionVersion) { mRemoteExecutor.executeGet(SERVER_PATH_SESSION, new JsonSessionHandler(mApplicationContext, PREFS_SESSION_VERSION, lastSessionVersion)); } // speaker management int localSpeakerVersion = prefs.getInt(PREFS_SPEAKER_VERSION, 0); int lastSpeakerVersion = VersionReader.getVersion(SERVER_PATH_SPEAKER_VERSION); if (localSpeakerVersion < lastSpeakerVersion) { mRemoteExecutor.executeGet(SERVER_PATH_SPEAKER, new JsonSpeakerHandler(mApplicationContext, PREFS_SPEAKER_VERSION, lastSpeakerVersion)); } if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "remote sync took " + (System.currentTimeMillis() - startRemote) + "ms"); } }
From source file:com.example.android.wearable.agendadata.MainActivity.java
@Override public void onConnectionFailed(ConnectionResult result) { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Disconnected from Google Api Service"); }//from www .j a v a 2 s . c o m if (mResolvingError) { // Already attempting to resolve an error. return; } else if (result.hasResolution()) { try { mResolvingError = true; result.startResolutionForResult(this, REQUEST_RESOLVE_ERROR); } catch (IntentSender.SendIntentException e) { // There was an error with the resolution intent. Try again. mResolvingError = false; mGoogleApiClient.connect(); } } else { mResolvingError = false; } }
From source file:com.xorcode.andtweet.PreferencesActivity.java
@Override protected void onResume() { super.onResume(); // Stop service to force preferences reload on the next start // Plus disable repeating alarms for awhile (till next start service...) AndTweetServiceManager.stopAndTweetService(this, true); showAllPreferences();//from w w w .j a v a 2s .c o m MyPreferences.getDefaultSharedPreferences().registerOnSharedPreferenceChangeListener(this); Uri uri = getIntent().getData(); if (uri != null) { if (MyLog.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "uri=" + uri.toString()); } if (CALLBACK_URI.getScheme().equals(uri.getScheme())) { // To prevent repeating of this task getIntent().setData(null); // This activity was started by Twitter ("Service Provider") // so start second step of OAuth Authentication process new OAuthAcquireAccessTokenTask().execute(uri); // and return back to default screen overrideBackButton = true; } } }
From source file:info.guardianproject.otr.app.im.app.WelcomeActivity.java
private void signIn(long accountId) { if (accountId == 0) { Log.w(TAG, "signIn: account id is 0, bail"); return;//w w w .ja va 2s . com } boolean isAccountEditable = mProviderCursor.getInt(ACTIVE_ACCOUNT_LOCKED) == 0; if (isAccountEditable && mProviderCursor.isNull(ACTIVE_ACCOUNT_PW_COLUMN)) { // no password, edit the account if (Log.isLoggable(TAG, Log.DEBUG)) Log.i(TAG, "no pw for account " + accountId); Intent intent = getEditAccountIntent(); startActivity(intent); finish(); return; } long providerId = mProviderCursor.getLong(PROVIDER_ID_COLUMN); String password = mProviderCursor.getString(ACTIVE_ACCOUNT_PW_COLUMN); boolean isActive = false; // TODO(miron) mSignInHelper.signIn(password, providerId, accountId, isActive); }
From source file:de.madvertise.android.sdk.MadvertiseView.java
private void showMraidView() { MadvertiseUtil.logMessage(null, Log.DEBUG, "Add rich media banner"); mMraidView = new MadvertiseMraidView(getContext().getApplicationContext(), mCallbackListener, mAnimationListener, mHandler, this); mMraidView.setPlacementType(mPlacementType); mMraidView.loadAd(mCurrentAd);/*from w w w .jav a 2 s .com*/ // animate the old views animateOldViews(); addView(mMraidView); final Animation animation = createAnimation(false); if (animation != null) { mMraidView.startAnimation(animation); } }
From source file:com.android.contacts.activities.PeopleActivity.java
@Override protected void onCreate(Bundle savedState) { if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "PeopleActivity.onCreate start"); }/* w w w .j a v a2s . c o m*/ super.onCreate(savedState); if (RequestPermissionsActivity.startPermissionActivity(this)) { return; } if (!processIntent(false)) { finish(); return; } mContactListFilterController = ContactListFilterController.getInstance(this); mContactListFilterController.checkFilterValidity(false); mContactListFilterController.addListener(this); mProviderStatusWatcher.addListener(this); mIsRecreatedInstance = (savedState != null); createViewsAndFragments(savedState); if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) { Log.d(Constants.PERFORMANCE_TAG, "PeopleActivity.onCreate finish"); } getWindow().setBackgroundDrawable(null); }
From source file:com.android.car.trust.CarBleTrustAgent.java
@Override public void onEscrowTokenRemoved(long handle, boolean successful) { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "onEscrowTokenRemoved. Handle: " + handle + " successful? " + successful); }/*ww w. j ava 2 s . co m*/ }