Java Code Examples for android.util.Log.v()

The following are Jave code examples for showing how to use v() of the android.util.Log class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: DailyZhiHu   File: CustomViewBehind.java   Source Code and License Vote up 6 votes
public void scrollBehindTo(View content, int x, int y) {
	int vis = View.VISIBLE;		
	if (mMode == SlidingMenu.LEFT) {
		if (x >= content.getLeft()) vis = View.INVISIBLE;
		scrollTo((int)((x + getBehindWidth())*mScrollScale), y);
	} else if (mMode == SlidingMenu.RIGHT) {
		if (x <= content.getLeft()) vis = View.INVISIBLE;
		scrollTo((int)(getBehindWidth() - getWidth() + 
				(x-getBehindWidth())*mScrollScale), y);
	} else if (mMode == SlidingMenu.LEFT_RIGHT) {
		mContent.setVisibility(x >= content.getLeft() ? View.INVISIBLE : View.VISIBLE);
		mSecondaryContent.setVisibility(x <= content.getLeft() ? View.INVISIBLE : View.VISIBLE);
		vis = x == 0 ? View.INVISIBLE : View.VISIBLE;
		if (x <= content.getLeft()) {
			scrollTo((int)((x + getBehindWidth())*mScrollScale), y);				
		} else {
			scrollTo((int)(getBehindWidth() - getWidth() + 
					(x-getBehindWidth())*mScrollScale), y);				
		}
	}
	if (vis == View.INVISIBLE)
		Log.v(TAG, "behind INVISIBLE");
	setVisibility(vis);
}
 
Example 2
Project: unity-obb-downloader   File: DownloadThread.java   Source Code and License Vote up 6 votes
/**
 * Report download progress through the database if necessary.
 */
private void reportProgress(State state, InnerState innerState) {
    long now = System.currentTimeMillis();
    if (innerState.mBytesSoFar - innerState.mBytesNotified
            > Constants.MIN_PROGRESS_STEP
            && now - innerState.mTimeLastNotification
            > Constants.MIN_PROGRESS_TIME) {
        // we store progress updates to the database here
        mInfo.mCurrentBytes = innerState.mBytesSoFar;
        mDB.updateDownloadCurrentBytes(mInfo);

        innerState.mBytesNotified = innerState.mBytesSoFar;
        innerState.mTimeLastNotification = now;

        long totalBytesSoFar = innerState.mBytesThisSession + mService.mBytesSoFar;

        if (Constants.LOGVV) {
            Log.v(Constants.TAG, "downloaded " + mInfo.mCurrentBytes + " out of "
                    + mInfo.mTotalBytes);
            Log.v(Constants.TAG, "     total " + totalBytesSoFar + " out of "
                    + mService.mTotalLength);
        }

        mService.notifyUpdateBytes(totalBytesSoFar);
    }
}
 
Example 3
Project: RLibrary   File: MD5Utils.java   Source Code and License Vote up 6 votes
public static boolean checkMD5(String md5, File updateFile) {
    if (TextUtils.isEmpty(md5) || updateFile == null) {
        Log.e(TAG, "MD5 string empty or updateFile null");
        return false;
    }

    String calculatedDigest = md5(updateFile);
    if (calculatedDigest == null) {
        Log.e(TAG, "calculatedDigest null");
        return false;
    }

    Log.v(TAG, "Calculated digest: " + calculatedDigest);
    Log.v(TAG, "Provided digest: " + md5);

    return calculatedDigest.equalsIgnoreCase(md5);
}
 
Example 4
Project: MovieGuide   File: MovieActivity.java   Source Code and License Vote up 6 votes
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider,
                                    YouTubePlayer youTubePlayer, boolean wasRestored) {
    if (!wasRestored) {
        if (LOG) {
            Log.v(TAG, "trailerData " + trailerData);
        }
        if (trailerData != null && !trailerData.isEmpty()) {
            Uri uri = trailerData.get(0).getTrailerUri();

            if (LOG) {
                Log.v(TAG, "trailerData " + trailerData.size());
            }
            String trailerCode = uri.getQueryParameter("v");
            if (trailerCode != null) {
                this.youTubePlayer = youTubePlayer;
                youTubePlayer.cueVideo(trailerCode);
            }
        } else {
            getFragmentManager().beginTransaction().remove(youTubePlayerFragment).commit();
        }
    }
}
 
Example 5
Project: letv   File: FragmentManagerImpl.java   Source Code and License Vote up 6 votes
public void hideFragment(Fragment fragment, int transition, int transitionStyle) {
    if (DEBUG) {
        Log.v(TAG, "hide: " + fragment);
    }
    if (!fragment.mHidden) {
        fragment.mHidden = true;
        if (fragment.mView != null) {
            Animation anim = loadAnimation(fragment, transition, false, transitionStyle);
            if (anim != null) {
                setHWLayerAnimListenerIfAlpha(fragment.mView, anim);
                fragment.mView.startAnimation(anim);
            }
            fragment.mView.setVisibility(8);
        }
        if (fragment.mAdded && fragment.mHasMenu && fragment.mMenuVisible) {
            this.mNeedMenuInvalidate = true;
        }
        fragment.onHiddenChanged(true);
    }
}
 
Example 6
Project: SimpleUILauncher   File: MemoryTracker.java   Source Code and License Vote up 6 votes
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    Log.v(TAG, "Received start id " + startId + ": " + intent);

    if (intent != null) {
        if (TestingUtils.ACTION_START_TRACKING.equals(intent.getAction())) {
            final int pid = intent.getIntExtra("pid", -1);
            final String name = intent.getStringExtra("name");
            final long start = intent.getLongExtra("start", System.currentTimeMillis());
            startTrackingProcess(pid, name, start);
        }
    }

    mHandler.sendEmptyMessage(MSG_START);

    return START_STICKY;
}
 
Example 7
Project: android-dev-challenge   File: NetworkUtils.java   Source Code and License Vote up 6 votes
/**
 * Builds the URL used to talk to the weather server using latitude and longitude of a
 * location.
 *
 * @param latitude  The latitude of the location
 * @param longitude The longitude of the location
 * @return The Url to use to query the weather server.
 */
private static URL buildUrlWithLatitudeLongitude(Double latitude, Double longitude) {
    Uri weatherQueryUri = Uri.parse(FORECAST_BASE_URL).buildUpon()
            .appendQueryParameter(LAT_PARAM, String.valueOf(latitude))
            .appendQueryParameter(LON_PARAM, String.valueOf(longitude))
            .appendQueryParameter(FORMAT_PARAM, format)
            .appendQueryParameter(UNITS_PARAM, units)
            .appendQueryParameter(DAYS_PARAM, Integer.toString(numDays))
            .build();

    try {
        URL weatherQueryUrl = new URL(weatherQueryUri.toString());
        Log.v(TAG, "URL: " + weatherQueryUrl);
        return weatherQueryUrl;
    } catch (MalformedURLException e) {
        e.printStackTrace();
        return null;
    }
}
 
Example 8
Project: cleanhood   File: CreateEventActivity.java   Source Code and License Vote up 6 votes
public  boolean isStoragePermissionGranted() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
                == PackageManager.PERMISSION_GRANTED) {
            Log.v(TAG,"Permission is granted");
            return true;
        } else {

            Log.v(TAG,"Permission is revoked");
            System.out.println("REQUESTING PERMISSION");
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1);
            return false;
        }
    }
    else{
        return true;
    }
}
 
Example 9
Project: android-project-gallery   File: RangeFileAsyncHttpResponseHandler.java   Source Code and License Vote up 6 votes
@Override
public void sendResponseMessage(HttpResponse response) throws IOException {
    if (!Thread.currentThread().isInterrupted()) {
        StatusLine status = response.getStatusLine();
        if (status.getStatusCode() == HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE) {
            //already finished
            if (!Thread.currentThread().isInterrupted())
                sendSuccessMessage(status.getStatusCode(), response.getAllHeaders(), null);
        } else if (status.getStatusCode() >= 300) {
            if (!Thread.currentThread().isInterrupted())
                sendFailureMessage(status.getStatusCode(), response.getAllHeaders(), null, new HttpResponseException(status.getStatusCode(), status.getReasonPhrase()));
        } else {
            if (!Thread.currentThread().isInterrupted()) {
                Header header = response.getFirstHeader(AsyncHttpClient.HEADER_CONTENT_RANGE);
                if (header == null) {
                    append = false;
                    current = 0;
                } else
                    Log.v(LOG_TAG, AsyncHttpClient.HEADER_CONTENT_RANGE + ": " + header.getValue());
                sendSuccessMessage(status.getStatusCode(), response.getAllHeaders(), getResponseData(response.getEntity()));
            }
        }
    }
}
 
Example 10
Project: RxRemote   File: RemoteObservable.java   Source Code and License Vote up 5 votes
/**
 * Reads and returns the correct type of data from the bundle
 */
@SuppressWarnings("unchecked")
private Object getData(Bundle remoteData, RemoteDataType dataType, String keyPrefix) {
    if (DEBUG) {
        Log.v(TAG, "Parsing datatype " + dataType);
    }
    switch (dataType) {
        case Parcelable:
            return remoteData.getParcelable(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Double:
            return remoteData.getDouble(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Float:
            return remoteData.getFloat(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Integer:
            return remoteData.getInt(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Long:
            return remoteData.getLong(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Byte:
            return remoteData.getByte(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Char:
            return remoteData.getChar(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Short:
            return remoteData.getShort(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case String:
            return remoteData.getString(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix);
        case Boolean:
            return (remoteData.getInt(RemoteEventManager.REMOTE_DATA_KEY + keyPrefix) == 1);
        case Parceler:
            return getParcelerData(remoteData, keyPrefix);
        case Remoter:
            return getRemoterData(remoteData, keyPrefix);
        case List:
            return getListData(remoteData, keyPrefix);

    }
    return null;
}
 
Example 11
Project: mDL-ILP   File: MdlApduService.java   Source Code and License Vote up 5 votes
@Override
public byte[] processCommandApdu(final byte[] commandApdu, final Bundle extras) {
    Log.v(TAG, "Received APDU: " + HexStrings.toHexString(commandApdu));
    final byte[] response = mdlSim.send(commandApdu);
    Log.v(TAG, "Returning APDU: " + HexStrings.toHexString(response));
    return response;
}
 
Example 12
Project: AppRTC-Android   File: TCPChannelClient.java   Source Code and License Vote up 5 votes
/**
 * Sends a message on the socket. Should only be called on the executor thread.
 */
public void send(String message) {
  Log.v(TAG, "Send: " + message);

  synchronized (rawSocketLock) {
    if (out == null) {
      reportError("Sending data on closed socket.");
      return;
    }

    out.write(message + "\n");
    out.flush();
  }
}
 
Example 13
Project: GitHub   File: LruBitmapPool.java   Source Code and License Vote up 5 votes
@Override
public synchronized void put(Bitmap bitmap) {
  if (bitmap == null) {
    throw new NullPointerException("Bitmap must not be null");
  }
  if (bitmap.isRecycled()) {
    throw new IllegalStateException("Cannot pool recycled bitmap");
  }
  if (!bitmap.isMutable() || strategy.getSize(bitmap) > maxSize
      || !allowedConfigs.contains(bitmap.getConfig())) {
    if (Log.isLoggable(TAG, Log.VERBOSE)) {
      Log.v(TAG, "Reject bitmap from pool"
              + ", bitmap: " + strategy.logBitmap(bitmap)
              + ", is mutable: " + bitmap.isMutable()
              + ", is allowed config: " + allowedConfigs.contains(bitmap.getConfig()));
    }
    bitmap.recycle();
    return;
  }

  final int size = strategy.getSize(bitmap);
  strategy.put(bitmap);
  tracker.add(bitmap);

  puts++;
  currentSize += size;

  if (Log.isLoggable(TAG, Log.VERBOSE)) {
    Log.v(TAG, "Put bitmap in pool=" + strategy.logBitmap(bitmap));
  }
  dump();

  evict();
}
 
Example 14
Project: ChatExchange-old   File: HueFragmentPagerAdapter.java   Source Code and License Vote up 5 votes
@Override
public Object instantiateItem(ViewGroup container, int position)
{
    if (mCurTransaction == null)
    {
        mCurTransaction = mFragmentManager.beginTransaction();
    }
    final long itemId = getItemId(position);
    // Do we already have this fragment?
    String name = makeFragmentName(container.getId(), itemId);
    Fragment fragment = mFragmentManager.findFragmentByTag(name);
    if (fragment != null)
    {
        if (DEBUG)
        {
            Log.v(TAG, "Attaching item #" + itemId + ": f=" + fragment);
        }
        mCurTransaction.attach(fragment);
    }
    else
    {
        fragment = getItem(position);
        if (DEBUG)
        {
            Log.v(TAG, "Adding item #" + itemId + ": f=" + fragment);
        }
        mCurTransaction.add(container.getId(), fragment,
                makeFragmentName(container.getId(), itemId));
    }
    if (fragment != mCurrentPrimaryItem)
    {
        fragment.setMenuVisibility(false);
        fragment.setUserVisibleHint(false);
    }
    return fragment;
}
 
Example 15
Project: boohee_v5.6   File: LoggerDefault.java   Source Code and License Vote up 4 votes
public int v(String tag, String msg) {
    return Log.v(tag, msg);
}
 
Example 16
Project: RxRemote   File: SampleServiceImpl.java   Source Code and License Vote up 4 votes
@Override
public RemoteObservable<FooParcelable> getFooObservable() {
    Log.v(TAG, "getFooObservable");
    return new RemoteObservable<>(new RemoteEventController<FooParcelable>() {
        boolean stopped = false;
        int counter = 0;
        Thread eventThread;

        @Override
        public void onSubscribed() {
            Log.v(TAG, "Foo onSubscribed");
            if (!stopped) {
                eventThread = new Thread(new Runnable() {
                    @Override
                    public void run() {
                        while (!stopped) {
                            try {
                                Thread.sleep(1000);
                                if (!stopped) {
                                    Log.v(TAG, "Sending event");
                                    sendEvent(new FooParcelable(String.valueOf(counter), counter));
                                    counter++;
                                }
                            } catch (Exception e) {
                                Log.e(TAG, "Exception in thread", e);
                            }
                        }
                        Log.v(TAG, "Out of thread");
                    }
                });
                eventThread.start();
            }
        }

        @Override
        public void onUnSubscribed() {
            Log.v(TAG, "foo onUnSubscribed");
            stopped = true;
            eventThread.interrupt();
            sendCompleted();
        }
    });
}
 
Example 17
Project: civify-app   File: IssueDetailsFragment.java   Source Code and License Vote up 4 votes
void addConfirmValue() {
    Log.v(TAG, "Adding confirm value in layout");
    TextView likesIssue = (TextView) mViewDetails.findViewById(R.id.likesText);
    likesIssue.setText("+" + mIssue.getConfirmVotes());
}
 
Example 18
Project: Cable-Android   File: MultiWaveView.java   Source Code and License Vote up 4 votes
private void handleUp(MotionEvent event) {
    if (DEBUG && mDragging) Log.v(TAG, "** Handle RELEASE");
    switchToState(STATE_FINISH, event.getX(), event.getY());
}
 
Example 19
Project: DC-Actor   File: DcActorCallbackPolicy.java   Source Code and License Vote up 4 votes
protected void onPrintStackElements(int index ,StackTraceElement ele) {
    Log.v("DcActorCallbackPolicy","["+index+"]"+ele.getClassName()+"."+ele.getMethodName()+"() #"+ele.getLineNumber());
}
 
Example 20
Project: WeatherStream   File: CustomViewAbove.java   Source Code and License Vote up 4 votes
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {

	if (!mEnabled)
		return false;

	final int action = ev.getAction() & MotionEventCompat.ACTION_MASK;

	if (DEBUG)
		if (action == MotionEvent.ACTION_DOWN)
			Log.v(TAG, "Received ACTION_DOWN");

	if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP
			|| (action != MotionEvent.ACTION_DOWN && mIsUnableToDrag)) {
		endDrag();
		return false;
	}

	switch (action) {
	case MotionEvent.ACTION_MOVE:
		determineDrag(ev);
		break;
	case MotionEvent.ACTION_DOWN:
		int index = MotionEventCompat.getActionIndex(ev);
		mActivePointerId = MotionEventCompat.getPointerId(ev, index);
		if (mActivePointerId == INVALID_POINTER)
			break;
		mLastMotionX = mInitialMotionX = MotionEventCompat.getX(ev, index);
		mLastMotionY = MotionEventCompat.getY(ev, index);
		if (thisTouchAllowed(ev)) {
			mIsBeingDragged = false;
			mIsUnableToDrag = false;
			if (isMenuOpen() && mViewBehind.menuTouchInQuickReturn(mContent, mCurItem, ev.getX() + mScrollX)) {
				mQuickReturn = true;
			}
		} else {
			mIsUnableToDrag = true;
		}
		break;
	case MotionEventCompat.ACTION_POINTER_UP:
		onSecondaryPointerUp(ev);
		break;
	}

	if (!mIsBeingDragged) {
		if (mVelocityTracker == null) {
			mVelocityTracker = VelocityTracker.obtain();
		}
		mVelocityTracker.addMovement(ev);
	}
	return mIsBeingDragged || mQuickReturn;
}