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

The following examples show how to use android.util.Log#v() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
/**
 * Builds the URL used to talk to the weather server using a location. This location is based
 * on the query capabilities of the weather provider that we are using.
 *
 * @param locationQuery The location that will be queried for.
 * @return The URL to use to query the weather server.
 */
private static URL buildUrlWithLocationQuery(String locationQuery) {
    Uri weatherQueryUri = Uri.parse(FORECAST_BASE_URL).buildUpon()
            .appendQueryParameter(QUERY_PARAM, locationQuery)
            .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 2
/**
 * This method converts the byte array to an integer array.
 *
 * @return : Integer Array
 * @parameter : b {the byte array}
 */

public static int[] byteArrayToIntArray(byte[] b) {

    Log.v("Size byte array", b.length + "");

    int size = b.length / 3;

    Log.v("Size Int array", size + "");

    System.runFinalization();
    //Garbage collection
    System.gc();

    Log.v("FreeMemory", Runtime.getRuntime().freeMemory() + "");
    int[] result = new int[size];
    int offset = 0;
    int index = 0;

    while (offset < b.length) {
        result[index++] = byteArrayToInt(b, offset);
        offset = offset + 3;
    }

    return result;
}
 
Example 3
Source Project: libcommon   File: ChannelBuilder.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * コンストラクタ
 * 新規に作成するとわかっている場合・既存設定を上書きする場合を除いて#getBuilderを使うほうがいい。
 * @param channelId nullならチャネルidはDEFAULT_CHANNEL_IDになる
 * @param name
 * @param importance
 * @param groupId
 * @param groupName
 */
public ChannelBuilder(
	@NonNull final Context context,
	@Nullable final String channelId,
	@Nullable final CharSequence name,
	@Importance final int importance,
	@Nullable final String groupId, @Nullable final String groupName) {

	if (DEBUG) Log.v(TAG, "Constructor:");
	this.mContext = context;
	this.channelId = TextUtils.isEmpty(channelId)
		? DEFAULT_CHANNEL_ID : channelId;
	this.name = name;
	this.importance = importance;
	this.groupId = groupId;
	this.groupName = groupName;
}
 
Example 4
Source Project: Study_Android_Demo   File: PtrCLog.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Send a VERBOSE log message.
 *
 * @param tag
 * @param msg
 * @param args
 */
public static void v(String tag, String msg, Object... args) {
    if (sLevel > LEVEL_VERBOSE) {
        return;
    }
    if (args.length > 0) {
        msg = String.format(msg, args);
    }
    Log.v(tag, msg);
}
 
Example 5
public static void LOGV(final String tag, String message, Throwable cause) {
    if (LOGGING_ENABLED) {
        if (Log.isLoggable(tag, Log.VERBOSE)) {
            Log.v(tag, message, cause);
        }
    }
}
 
Example 6
public void startPollLoop() {
    Log.v(TAG, "startPollLoop()");

    if (pollThread != null) {
        pollThread.interrupt();
    }

    Log.v(TAG, "Starting poll loop");
    pollThread = new Thread(pollLoop);
    pollThread.start();
}
 
Example 7
/**
 * called from native code to update our status
 */
private void reportStatus(int status) {
    if (DEBUG) Log.v(TAG, "reportStatus status: " + status);

    boolean wasNavigating = mNavigating;
    switch (status) {
        case GPS_STATUS_SESSION_BEGIN:
            mNavigating = true;
            mEngineOn = true;
            break;
        case GPS_STATUS_SESSION_END:
            mNavigating = false;
            break;
        case GPS_STATUS_ENGINE_ON:
            mEngineOn = true;
            break;
        case GPS_STATUS_ENGINE_OFF:
            mEngineOn = false;
            mNavigating = false;
            break;
    }

    if (wasNavigating != mNavigating) {
        mListenerHelper.onStatusChanged(mNavigating);

        // send an intent to notify that the GPS has been enabled or disabled
        Intent intent = new Intent(LocationManager.GPS_ENABLED_CHANGE_ACTION);
        intent.putExtra(LocationManager.EXTRA_GPS_ENABLED, mNavigating);
        mContext.sendBroadcastAsUser(intent, UserHandle.ALL);
    }
}
 
Example 8
@WXComponentProp(name = "viewBox")
public void setViewBox(String viewBox) {
  String box = viewBox;
  Log.v("WXSvgContainer", "box is " + box);
  if (!TextUtils.isEmpty(box)) {
    String[] p = box.split(" ");
    if (p != null && p.length == 4) {
      mViewBoxX = Integer.valueOf(p[0]);
      mViewBoxY = Integer.valueOf(p[1]);
      mviewBoxWidth = Integer.valueOf(p[2]);
      mviewBoxHeight = Integer.valueOf(p[3]);
    }
  }
}
 
Example 9
Source Project: Fatigue-Detection   File: RenderHandler.java    License: MIT License 5 votes vote down vote up
public static final RenderHandler createHandler(final String name,int width, int height) {
	if (DEBUG) Log.v(TAG, "createHandler:");
	final RenderHandler handler = new RenderHandler(width,height);
	synchronized (handler.mSync) {
		new Thread(handler, !TextUtils.isEmpty(name) ? name : TAG).start();
		try {
			handler.mSync.wait();
		} catch (final InterruptedException e) {
		}
	}
	return handler;
}
 
Example 10
Source Project: ViewPrinter   File: PrinterLogger.java    License: Apache License 2.0 5 votes vote down vote up
void v(String message) {
    if (should(LEVEL_VERBOSE)) {
        Log.v(mTag, message);
        lastMessage = message;
        lastTag = mTag;
    }
}
 
Example 11
Source Project: WeatherStream   File: CustomViewAbove.java    License: Apache License 2.0 5 votes vote down vote up
private boolean thisSlideAllowed(float dx) {
	boolean allowed = false;
	if (isMenuOpen()) {
		allowed = mViewBehind.menuOpenSlideAllowed(dx);
	} else {
		allowed = mViewBehind.menuClosedSlideAllowed(dx);
	}
	if (DEBUG)
		Log.v(TAG, "this slide allowed " + allowed + " dx: " + dx);
	return allowed;
}
 
Example 12
Source Project: libcommon   File: ServiceRecorder.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 関係するリソースを破棄する
 */
public void release() {
	if (!mReleased) {
		mReleased = true;
		if (DEBUG) Log.v(TAG, "release:");
		internalRelease();
	}
}
 
Example 13
Source Project: Fatigue-Detection   File: EGLBase.java    License: MIT License 5 votes vote down vote up
private void init(EGLContext shared_context, final boolean with_depth_buffer, final boolean isRecordable) {
	if (DEBUG) Log.v(TAG, "init:");
       if (mEglDisplay != EGL14.EGL_NO_DISPLAY) {
           throw new RuntimeException("EGL already set up");
       }

       mEglDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY);
       if (mEglDisplay == EGL14.EGL_NO_DISPLAY) {
           throw new RuntimeException("eglGetDisplay failed");
       }

	final int[] version = new int[2];
       if (!EGL14.eglInitialize(mEglDisplay, version, 0, version, 1)) {
       	mEglDisplay = null;
           throw new RuntimeException("eglInitialize failed");
       }

	shared_context = shared_context != null ? shared_context : EGL14.EGL_NO_CONTEXT;
       if (mEglContext == EGL14.EGL_NO_CONTEXT) {
           mEglConfig = getConfig(with_depth_buffer, isRecordable);
           if (mEglConfig == null) {
               throw new RuntimeException("chooseConfig failed");
           }
           // create EGL rendering context
        mEglContext = createContext(shared_context);
       }
       // confirm whether the EGL rendering context is successfully created
       final int[] values = new int[1];
       EGL14.eglQueryContext(mEglDisplay, mEglContext, EGL14.EGL_CONTEXT_CLIENT_VERSION, values, 0);
       if (DEBUG) Log.d(TAG, "EGLContext created, client version " + values[0]);
       makeDefault();	// makeCurrent(EGL14.EGL_NO_SURFACE);
}
 
Example 14
Source Project: WhatsApp-Cleaner   File: CheckRecentRun.java    License: MIT License 5 votes vote down vote up
public void setAlarm() {

        Intent serviceIntent = new Intent(this, CheckRecentRun.class);
        PendingIntent pi = PendingIntent.getService(this, 131313, serviceIntent,
                PendingIntent.FLAG_CANCEL_CURRENT);

        AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
        if (am != null) {
            am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + delay, pi);
        }
        Log.v(TAG, "Alarm set");
    }
 
Example 15
Source Project: SaveVolley   File: VolleyLog.java    License: Apache License 2.0 4 votes vote down vote up
public static void v(String format, Object... args) {
    if (DEBUG) {
        Log.v(TAG, buildMessage(format, args));
    }
}
 
Example 16
public PhaseAlignController(PhaseConfig config, MainActivity context) {
  handler = new Handler();
  phaseAligner = new PhaseAligner(config);
  Log.v(TAG, "Loaded phase align config.");
  this.context = context;
}
 
Example 17
Source Project: GitJourney   File: StarsListFragment.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Loader<List<StarsDataEntry>> onCreateLoader(int id, Bundle args) {
    Log.v(TAG, "onCreateLoader " + args);
    return new StarsLoader(getContext(), args.getInt("page"));
}
 
Example 18
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
    if (debug) {
        Log.v(TAG, String.format("Status for LocationProvider %s changed to %d.", provider, status));
    }
}
 
Example 19
@Override
public void release() {
	if (DEBUG) Log.v(TAG, "release:");
	mEglTask.release();
	super.release();
}
 
Example 20
Source Project: Reader   File: LogUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static void v(String tag, String outMessage) {
    if (DEV_BUILD) {
        Log.v(tag, outMessage);
    }
}