Example usage for android.util Log e

List of usage examples for android.util Log e

Introduction

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

Prototype

public static int e(String tag, String msg) 

Source Link

Document

Send an #ERROR log message.

Usage

From source file:Main.java

public static String getVerName(Context context) {
    String verName = "";
    try {/*from w  w  w  .  ja v  a  2  s  .  c om*/
        verName = context.getPackageManager().getPackageInfo("com.myapp", 0).versionName;
    } catch (NameNotFoundException e) {
        Log.e("AppUtil", e.getMessage());
    }
    return verName;
}

From source file:Main.java

public static String getTypeByID(int template_id) {

    Log.e("util", template_id + "!!!!!!!!!!!!");

    if (template_id == 6)
        return NOTEBOOK;
    else if (template_id == 7)
        return BRIEFNOTE;
    else if (template_id == 8)
        return BUSINESS;
    else if (template_id == 9)
        return CHECKER;
    else if (template_id == 10)
        return WINI;
    else/*from   w w w  .  j ava2s  . c om*/
        return NOTEBOOK;
}

From source file:Main.java

public static void e(String tag, String msg) {
    if (isDebug) {
        if (tag == null || "".equalsIgnoreCase(tag.trim())) {
            tag = mTag;/*from   w  ww  . jav a  2s.c  om*/
        }
        Log.e(tag, msg);
    }
}

From source file:Main.java

public static byte[] getMessageDigest(byte[] data, String algorithm) {
    try {/*from   w ww .  ja v a  2s  . com*/
        final MessageDigest md = MessageDigest.getInstance(algorithm);
        final byte[] digest = md.digest(data);
        return digest;
    } catch (final NoSuchAlgorithmException e) {
        Log.e(e.getMessage(), e.getMessage());
        throw new RuntimeException(e);
    }
}

From source file:Main.java

public static String getVerName(Context context) {
    String verName = "";
    try {/* w w w  .  ja va2 s. com*/
        verName = context.getPackageManager().getPackageInfo("com.wangln", 0).versionName;
    } catch (NameNotFoundException e) {
        Log.e("msg", e.getMessage());
    }
    return verName;
}

From source file:Main.java

public static Bitmap getBitmap(String path, BitmapFactory.Options options, float maxH, float maxW) {
    Bitmap cameraBitmap = null;//from  www .ja  v  a  2 s  .c om
    int be = 1;
    float maxh = (int) ((maxH / 100.0) + 0.5) * 100;
    float maxw = (int) ((maxW / 100.0) + 0.5) * 100;
    Log.e("maxh", maxh + "");
    Log.e("maxw", maxw + "");
    options.inJustDecodeBounds = true;
    cameraBitmap = BitmapFactory.decodeFile(path, options);
    options.inJustDecodeBounds = false;
    int h = options.outHeight;
    int w = options.outWidth;
    Log.e("h", h + "");
    Log.e("w", w + "");
    if (h > maxh || w > maxw) {
        int beh = (int) ((h / maxh) + 0.5);
        int bew = (int) ((w / maxw) + 0.5);
        Log.e("beh", beh + "");
        Log.e("bew", bew + "");
        if (beh > bew) {
            be = beh;
        } else {
            be = bew;
        }
    }
    options.inSampleSize = be;
    cameraBitmap = BitmapFactory.decodeFile(path, options);
    return cameraBitmap;
}

From source file:Main.java

/**
 * prints the passed array/*from  w  ww . java  2s .c om*/
 * @param _tag the tag for the print
 * @param arr the array to print
 */
public static void printArray(String _tag, double[] arr) {
    StringBuffer sb = new StringBuffer();

    for (int i = 0; i < arr.length; i++) {
        sb.append(arr[i]);
        sb.append("\n");
    }
    Log.e(_tag, sb.toString());
    Log.e(_tag, "--------------------");
}

From source file:Main.java

public static String getVerName(Context context) {
    String verName = "";
    try {/*from   w w  w .j a  v a2s.c  om*/
        verName = context.getPackageManager().getPackageInfo("com.haocai.wms", 0).versionName;
    } catch (NameNotFoundException e) {
        Log.e("msg", e.getMessage());
    }
    return verName;
}

From source file:Main.java

public static InputStream fileToInputStream(String fileName) throws FileNotFoundException {
    File file = new File(fileName);

    if (!file.exists()) {
        Log.e(TAG, fileName + " not found.");
        return null;
    }//from   www . j a  v a2s  . co m

    return new FileInputStream(file);
}

From source file:Main.java

public static final void toastMessage(final Activity activity, final String message, String logLevel) {
    if ("w".equals(logLevel)) {
        Log.w("sdkDemo", message);
    } else if ("e".equals(logLevel)) {
        Log.e("sdkDemo", message);
    } else {//from www .  ja  v  a2 s .co m
        Log.d("sdkDemo", message);
    }
    activity.runOnUiThread(new Runnable() {
        @Override
        public void run() {
            // TODO Auto-generated method stub
            if (mToast != null) {
                mToast.cancel();
                mToast = null;
            }
            mToast = Toast.makeText(activity, message, Toast.LENGTH_SHORT);
            mToast.show();
        }
    });
}