List of usage examples for android.util Log VERBOSE
int VERBOSE
To view the source code for android.util Log VERBOSE.
Click Source Link
From source file:android.percent.support.PercentLayoutHelper.java
private static PercentLayoutInfo setWidthAndHeightVal(TypedArray array, PercentLayoutInfo info) { PercentLayoutInfo.PercentVal percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_widthPercent, true); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent width: " + percentVal.percent); }//from w w w . j a va2s . c o m info = checkForInfoExists(info); info.widthPercent = percentVal; } percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_heightPercent, false); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent height: " + percentVal.percent); } info = checkForInfoExists(info); info.heightPercent = percentVal; } return info; }
From source file:com.github.vseguip.sweet.rest.SugarRestAPI.java
@Override /** {@inheritDoc} */ public List<ISweetContact> getNewerContacts(String token, String date, int start, int count) throws IOException, AuthenticationException { final HttpResponse resp; Log.i(TAG, "getNewerContacts()"); JSONArray jso_array = new JSONArray(); JSONArray jso_fields = new JSONArray(); // TODO: add newer fields (adress and other phones) jso_fields.put(SUGARCRM_CONTACT_ID_FIELD).put(SUGARCRM_FIRST_NAME_FIELD).put(SUGARCRM_LAST_NAME_FIELD) .put(SUGARCRM_TITLE_FIELD).put(SUGARCRM_ACCOUNT_NAME_FIELD).put(SUGARCRM_ACCOUNT_ID_FIELD) .put(SUGARCRM_EMAIL1_FIELD).put(SUGARCRM_PHONE_WORK_FIELD).put(SUGARCRM_PHONE_MOBILE_FIELD) .put(SUGARCRM_FAX_WORK_FIELD).put(SUGARCRM_STREET_FIELD).put(SUGARCRM_CITY_FIELD) .put(SUGARCRM_STATE_FIELD).put(SUGARCRM_POSTAL_CODE_FIELD).put(SUGARCRM_COUNTRY_FIELD) .put(SUGARCRM_DATE_MODIFIED_FIELD); String sugar_query = SUGAR_CONTACTS_QUERY; if (date != null) sugar_query = "(contacts.date_modified >= '" + date + "')"; jso_array.put(token).put(SUGAR_MODULE_CONTACTS).put(sugar_query).put(SUGAR_CONTACTS_ORDER_BY).put(start) .put(jso_fields).put(SUGAR_CONTACT_LINK_NAMES).put(count).put(0); final HttpPost post = prepareJSONRequest(jso_array.toString(), GET_METHOD); HttpClient httpClient = getConnection(); Log.i(TAG, "Sending request"); resp = httpClient.execute(post);// w ww .ja v a2s . com Log.i(TAG, "Got response"); if (resp.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Successful authentication"); } Log.i(TAG, "Buffering request"); List<ISweetContact> contacts = new ArrayList<ISweetContact>(); String message = getResponseString(resp); JSONArray result; JSONObject json = null; try { Log.i(TAG, "Parsing response"); json = (JSONObject) new JSONTokener(message).nextValue(); result = json.getJSONArray("entry_list"); Log.i(TAG, "Creating contact objects"); for (int i = 0; i < result.length(); i++) { try { // ID, first name and last name are compulsory, the rest // can be skipped JSONObject entrada = result.getJSONObject(i).getJSONObject("name_value_list"); contacts.add(new SweetContact( getJSONString(entrada.getJSONObject(SUGARCRM_CONTACT_ID_FIELD).getString("value")), getJSONString(entrada.getJSONObject(SUGARCRM_FIRST_NAME_FIELD).getString("value")), getJSONString(entrada.getJSONObject(SUGARCRM_LAST_NAME_FIELD).getString("value")), getSugarValue(entrada, SUGARCRM_TITLE_FIELD, ""), getSugarValue(entrada, SUGARCRM_ACCOUNT_NAME_FIELD, ""), getSugarValue(entrada, SUGARCRM_ACCOUNT_ID_FIELD, ""), getSugarValue(entrada, SUGARCRM_EMAIL1_FIELD, ""), getSugarValue(entrada, SUGARCRM_PHONE_WORK_FIELD, ""), getSugarValue(entrada, SUGARCRM_PHONE_MOBILE_FIELD, ""), getSugarValue(entrada, SUGARCRM_FAX_WORK_FIELD, ""), getSugarValue(entrada, SUGARCRM_STREET_FIELD, ""), getSugarValue(entrada, SUGARCRM_CITY_FIELD, ""), getSugarValue(entrada, SUGARCRM_STATE_FIELD, ""), getSugarValue(entrada, SUGARCRM_POSTAL_CODE_FIELD, ""), getSugarValue(entrada, SUGARCRM_COUNTRY_FIELD, ""), getSugarValue(entrada, SUGARCRM_DATE_MODIFIED_FIELD, ""))); } catch (Exception ex) { ex.printStackTrace(); Log.e(TAG, "Unknown error parsing, skipping entry"); } } return contacts; } catch (Exception e) { if (json != null) { Log.i(TAG, "Error parsing json in getNewerContacts. Auth invalid"); try { throw new AuthenticationException(json.getString("description")); } catch (JSONException ex) { throw new AuthenticationException("Invalid session"); } } } finally { httpClient.getConnectionManager().closeIdleConnections(100, TimeUnit.MILLISECONDS); } } else { Log.v(TAG, "Error authenticating" + resp.getStatusLine()); throw new AuthenticationException("Invalid session"); } return null; }
From source file:com.google.android.dialer.provider.DialerProvider.java
private String executeHttpRequest(Uri uri) throws IOException { String charset = null;/*www . j ava 2s . c o m*/ if (Log.isLoggable("DialerProvider", Log.VERBOSE)) { Log.v("DialerProvider", "executeHttpRequest(" + uri + ")"); } try { URLConnection conn = new URL(uri.toString()).openConnection(); conn.setRequestProperty("User-Agent", mUserAgent); InputStream inputStream = conn.getInputStream(); charset = getCharsetFromContentType(conn.getContentType()); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); byte[] buf = new byte[1000]; while (true) { int len = inputStream.read(buf); if (len <= 0) { break; } outputStream.write(buf, 0, len); } inputStream.close(); outputStream.flush(); return new String(outputStream.toByteArray(), charset); } catch (UnsupportedEncodingException e) { Log.w("DialerProvider", "Invalid charset: " + charset, e); } catch (IOException e) { // TODO: Didn't find anything that goes here in byte-code } // TODO: Is this appropriate? return null; }
From source file:com.example.everyoneassist.Layout.PercentLayoutHelper.java
private static PercentLayoutInfo setTextSizeSupportVal(TypedArray array, PercentLayoutInfo info) { //textSizePercent PercentLayoutInfo.PercentVal percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_textSizePercent, false); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent text size: " + percentVal.percent); }/* ww w .j a v a 2 s . c om*/ info = checkForInfoExists(info); info.textSizePercent = percentVal; } return info; }
From source file:com.digipom.manteresting.android.service.cache.CacheService.java
/** * Returns the decoded bitmap, if available. If not, returns null and queues * a load request. The bitmap will be decoded from one of the image caches * or downloaded, if necessary. Once complete, the callback will be called * with the status of the load. The width is used to determine the minimum * quality required. This method could return a bitmap of the best quality * found, and still call the callback if a higher quality bitmap is needed. * /*from w w w. j a v a 2 s .c o m*/ */ public Bitmap getOrLoadLifoAsync(String originalUriFromJson, int requestedWidth, BitmapLoadCallback bitmapLoadCallback) { if (LoggerConfig.canLog(Log.VERBOSE)) { Log.v(TAG, "getOrLoadLifoAsync(" + originalUriFromJson + ", " + requestedWidth + ", " + bitmapLoadCallback + ")"); } Bitmap cachedBitmap = null; if (bitmapMemoryCache != null) { final BitmapWithCategory bitmapWithCategory = bitmapMemoryCache.get(originalUriFromJson); cachedBitmap = bitmapWithCategory != null ? bitmapWithCategory.bitmap : null; if (!isCachedBitmapAdequateForWidth(originalUriFromJson, requestedWidth)) { // We'll need to load the bitmap asynchronously. queueOrUpdateRunnable(originalUriFromJson, requestedWidth, bitmapLoadCallback, System.nanoTime()); } else { if (LoggerConfig.canLog(Log.VERBOSE)) { Log.v(TAG, "URI " + originalUriFromJson + " already cached."); } } } return cachedBitmap; }
From source file:com.xorcode.andtweet.FriendTimeline.java
/** * Remove old records to ensure that the database does not grow too large. * Maximum number of records is configured in "history_size" preference * /* w ww . j ava 2 s.c o m*/ * @return Number of deleted records */ public int pruneOldRecords() { int nDeleted = 0; int nDeletedTime = 0; // We're using global preferences here SharedPreferences sp = MyPreferences.getDefaultSharedPreferences(); int maxDays = Integer.parseInt(sp.getString(MyPreferences.KEY_HISTORY_TIME, "3")); long sinceTimestamp = 0; if (maxDays > 0) { sinceTimestamp = System.currentTimeMillis() - maxDays * (1000L * 60 * 60 * 24); SelectionAndArgs sa = new SelectionAndArgs(); sa.addSelection(AndTweetDatabase.Tweets.SENT_DATE + " < ?", new String[] { String.valueOf(sinceTimestamp) }); if (mTimelineType != AndTweetDatabase.Tweets.TIMELINE_TYPE_MESSAGES) { // Don't delete Favorites! sa.addSelection(AndTweetDatabase.Tweets.FAVORITED + " = ?", new String[] { "0" }); } nDeletedTime = mContentResolver.delete(mContentUri, sa.selection, sa.selectionArgs); } int nTweets = 0; int nToDeleteSize = 0; int nDeletedSize = 0; int maxSize = Integer.parseInt(sp.getString(MyPreferences.KEY_HISTORY_SIZE, "2000")); long sinceTimestampSize = 0; if (maxSize > 0) { try { nDeletedSize = 0; Cursor cursor = mContentResolver.query(mContentCountUri, null, null, null, null); if (cursor.moveToFirst()) { // Count is in the first column nTweets = cursor.getInt(0); nToDeleteSize = nTweets - maxSize; } cursor.close(); if (nToDeleteSize > 0) { // Find SENT_DATE of the most recent tweet to delete cursor = mContentResolver.query(mContentUri, new String[] { AndTweetDatabase.Tweets.SENT_DATE }, null, null, "sent ASC LIMIT 0," + nToDeleteSize); if (cursor.moveToLast()) { sinceTimestampSize = cursor.getLong(0); } cursor.close(); if (sinceTimestampSize > 0) { SelectionAndArgs sa = new SelectionAndArgs(); sa.addSelection(AndTweetDatabase.Tweets.SENT_DATE + " <= ?", new String[] { String.valueOf(sinceTimestampSize) }); if (mTimelineType != AndTweetDatabase.Tweets.TIMELINE_TYPE_MESSAGES) { sa.addSelection(AndTweetDatabase.Tweets.FAVORITED + " = ?", new String[] { "0" }); } nDeletedSize = mContentResolver.delete(mContentUri, sa.selection, sa.selectionArgs); } } } catch (Exception e) { Log.e(TAG, "pruneOldRecords failed"); e.printStackTrace(); } } nDeleted = nDeletedTime + nDeletedSize; if (MyLog.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "pruneOldRecords; History time=" + maxDays + " days; deleted " + nDeletedTime + " , since " + sinceTimestamp + ", now=" + System.currentTimeMillis()); Log.v(TAG, "pruneOldRecords; History size=" + maxSize + " tweets; deleted " + nDeletedSize + " of " + nTweets + " tweets, since " + sinceTimestampSize); } return nDeleted; }
From source file:com.lyp.percent.PercentLayoutHelper.java
private static PercentLayoutInfo setTextSizeSupportVal(TypedArray array, PercentLayoutInfo info) { //textSizePercent ? PercentLayoutInfo.PercentVal percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_textSizePercent, false); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent text size: " + percentVal.percent); }//from w w w . j ava2 s.c o m info = checkForInfoExists(info); info.textSizePercent = percentVal; } return info; }
From source file:caesar.feng.framework.percentlayout.PercentLayoutHelper.java
private static PercentLayoutInfo setTextSizeSupportVal(TypedArray array, PercentLayoutInfo info) { //textSizePercent PercentLayoutInfo.PercentVal percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_textSizePercent, false); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent text size: " + percentVal.percent); }//w ww. j a v a 2s. c o m info = checkForInfoExists(info); info.textSizePercent = percentVal; } return info; }
From source file:com.example.recycleviewtest.PercentLayoutHelper.java
private static PercentLayoutInfo setTextSizeSupportVal(TypedArray array, PercentLayoutInfo info) { //textSizePercent ??? PercentLayoutInfo.PercentVal percentVal = getPercentVal(array, R.styleable.PercentLayout_Layout_layout_textSizePercent, false); if (percentVal != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "percent text size: " + percentVal.percent); }//w ww .java 2s . c o m info = checkForInfoExists(info); info.textSizePercent = percentVal; } return info; }
From source file:com.googlecode.eyesfree.brailleback.IMENavigationMode.java
/** Changes state, possibly notifying the next navigation mode. */ private void setState(State newState) { if (mState == newState) { return;//from ww w. ja v a 2 s . c o m } State oldState = mState; mState = newState; if (oldState.controlsDisplay() && !newState.controlsDisplay()) { activateNext(); } else if (!oldState.controlsDisplay() && newState.controlsDisplay()) { deactivateNext(); BrailleIME ime = getIME(); if (ime != null) { ime.updateDisplay(); } } LogUtils.log(this, Log.VERBOSE, "state change: %s -> %s", oldState, newState); }