Example usage for android.util Log i

List of usage examples for android.util Log i

Introduction

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

Prototype

public static int i(String tag, String msg) 

Source Link

Document

Send an #INFO log message.

Usage

From source file:Main.java

public static void sendSMS(String phoneNo, String message, Context context) {
    Log.i("Sending SMS to " + phoneNo, "");

    try {//from   w  ww.  ja v a  2  s.c  o  m
        SmsManager smsManager = SmsManager.getDefault();
        smsManager.sendTextMessage(phoneNo, null, message, null, null);
        Toast.makeText(context, "SMS sent to " + phoneNo, Toast.LENGTH_SHORT).show();
    } catch (Exception e) {
        Toast.makeText(context, "SMS sending failed to " + phoneNo, Toast.LENGTH_SHORT).show();
        e.printStackTrace();
    }
}

From source file:Main.java

static private void log(String msg) {
    Log.i(TAG, msg);
}

From source file:Main.java

public static boolean isFastDoubleClick() {
    long time = System.currentTimeMillis();
    long timeD = time - lastClickTime;
    lastClickTime = time;/* w ww  . j  a  v  a  2 s.  c om*/
    Log.i("log", "" + timeD);
    return timeD <= 100;
}

From source file:Main.java

public static void ZLog(String Tag, String Message) {
    if (BaatnaLog && Message != null)
        Log.i(Tag, Message);
}

From source file:Main.java

public static void i(String tag, String msg) {
    if (isShow) {
        Log.i(tag, msg);
    }
}

From source file:Main.java

public static String getImgUrl(String str, int type) {
    Log.i("ImageUrlHelper", "Str0:" + str);
    if (str.contains("src"))
        str = str.substring(str.indexOf("src"), str.length());
    if (str.contains("http://"))
        str = str.substring(str.indexOf("http://"), str.length());
    String format = "";
    if (str.contains(".jpeg"))
        format = ".jpeg";
    else if (str.contains(".png"))
        format = ".png";
    else if (str.contains(".gif"))
        format = ".gif";
    else if (str.contains(".jpg"))
        format = ".jpg";
    else// www .  java2  s  . c  o  m
        format = str.substring(str.length() - 4);
    switch (type) {
    case NEWS_IMG_URL:
        do {
            str = str.substring(0, str.lastIndexOf(format));
        } while (str.lastIndexOf(format) > 1);
        if (str.contains("_100x100"))
            str = str.substring(0, str.length() - 8);
        str = str + format;
        if (str.contains("article/")) {
            str = "http://static.cnbetacdn.com/" + str.substring(str.indexOf("article/"));
        }
        break;

    case CONTENT_IMG_URL:
        str = str.substring(0, str.indexOf(format + "\""));
        str = str + format;
        break;
    }
    ;
    return str;
}

From source file:Main.java

public static boolean isInMainThread() {
    Looper myLooper = Looper.myLooper();
    Looper mainLooper = Looper.getMainLooper();
    Log.i(TAG, "isInMainThread myLooper=" + myLooper + ";mainLooper=" + mainLooper);
    return myLooper == mainLooper;
}

From source file:Main.java

public static String printByteArrayAsInt(String caller, byte[] data) {
    String ret = "";
    for (int i = 0; i < data.length; i++) {
        ret += Integer.toHexString((int) (data[i] & 0xFF)) + ",";
        Log.i(caller, "Byte " + i + " is " + Integer.toHexString((int) (data[i] & 0xFF)));
    }//from w  w  w . ja  v  a  2 s .co  m
    return ret;
}

From source file:Main.java

private static String findNext(Calendar cal, String[] arr) {
    for (String s : arr) {
        if (isBefore(cal, s)) {
            return s;
        }//w  ww.  ja  va  2 s .c om
    }
    Log.i("utils.java findNext", "no next bus found for date:" + cal.toString());
    return null;
}

From source file:Main.java

public static String getImei(Context context) {
    TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    Log.i("IMEI", tm.getDeviceId());
    return tm.getDeviceId();
}