Example usage for android.util Log d

List of usage examples for android.util Log d

Introduction

In this page you can find the example usage for android.util Log d.

Prototype

public static int d(String tag, String msg) 

Source Link

Document

Send a #DEBUG log message.

Usage

From source file:Main.java

public static void dismissNotification(final Context context, int notificationId) {
    Log.d(TAG, "dismissNotification notificationID=" + notificationId);
    NotificationManager notifManager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);

    notifManager.cancel(notificationId);
}

From source file:Main.java

public static void debug(String info) {
    Log.d("pj", info);
}

From source file:Main.java

private static void logPrint(String tag, String prefix, String method, String text) {

    Log.d(tag, prefix + method + ", " + text);
}

From source file:Main.java

static void alert(Activity act, String Tag, String message) {
    AlertDialog.Builder bld = new AlertDialog.Builder(act);
    bld.setMessage(message);/*from  www  .  j a v a  2s. co  m*/
    bld.setNeutralButton("OK", null);
    Log.d(Tag, "Showing alert dialog: " + message);
    bld.create().show();
}

From source file:Main.java

public static void d(String TAG, String msg) {
    if (DEBUG) {/*from ww  w.  j  a v a 2  s .  c o m*/
        Log.d(TAG, "[" + getFileLineMethod() + "]" + msg);
    }
}

From source file:Main.java

static File rename(File file, String newName) {
    File newFile = new File(file.getParent(), newName);
    if (!newFile.equals(file)) {
        if (newFile.exists()) {
            if (newFile.delete()) {
                Log.d("FileUtil", "Delete old " + newName + " file");
            }/*from w w w  .  ja v a  2  s .co  m*/
        }
        if (file.renameTo(newFile)) {
            Log.d("FileUtil", "Rename file to " + newName);
        }
    }
    return newFile;
}

From source file:Main.java

public static String[] removeLocalUserNameFromArray(String[] user) {
    ArrayList<String> userList = new ArrayList<String>();
    for (int i = 0; i < user.length; i++) {
        Log.d("i=" + i, user[i]);
        if (USER_NAME.equals(user[i]) == false) {
            userList.add(user[i]);//from   w w  w.jav a2  s  . c  o m
        }
    }
    String returnArray[] = new String[userList.size()];
    for (int i = 0; i < returnArray.length; i++) {
        returnArray[i] = userList.get(i).toString();
    }
    return returnArray;
}

From source file:Main.java

public static void d(String text) {
    if (debug) {
        Log.d(TAG, text);
    }
}

From source file:Main.java

public static float getValue(Bitmap bitmap, int x, int y) {
    if (x < 0 || y < 0 || x > (bitmap.getWidth() - 1) || y > (bitmap.getHeight() - 1))
        Log.d("GET PIXEL ERROR!!!!!!!!!!!!",
                "X,Y is " + x + "," + y + "\tmax X,Y is" + bitmap.getWidth() + "," + bitmap.getHeight());
    int color = bitmap.getPixel(x, y);
    int red = Color.red(color);
    int green = Color.green(color);
    int blue = Color.blue(color);
    float intensity = (float) (0.299 * red + 0.587 * green + 0.114 * blue);
    return intensity;
}

From source file:Main.java

public static void writeFile(InputStream in, File file) throws IOException {
    Log.d(TAG, "write file=====start==");
    if (!file.getParentFile().exists())
        file.getParentFile().mkdirs();/*ww w. java  2s  . c  o m*/

    if (file != null && file.exists())
        file.delete();

    FileOutputStream out = new FileOutputStream(file);
    byte[] buffer = new byte[1024 * 128];
    int len = -1;
    while ((len = in.read(buffer)) != -1) {
        out.write(buffer, 0, len);
    }
    Log.d(TAG, "write file====success===");
    out.flush();
    out.close();
    in.close();

}