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

/**
 * Close a InputStream passed in.//from  w ww  . j a v a 2s.  com
 *
 * @param stream - InputStream to be closed.
 */
public static void closeBufferedReader(BufferedReader stream, String tag) {
    if (stream != null) {
        try {
            stream.close();
        } catch (IOException e) {
            Log.e(tag, "Exception occured when closing BufferedReader." + e);
        }
    }
}

From source file:Main.java

public static void e(String msg) {
    if (isShow) {
        Log.e(TAG, msg);
    }
}

From source file:Main.java

/**
 * Checks if we've had an error inside of OpenGL ES, and if so what that error is.
 *
 * @param label Label to report in case of error.
 *//*from  w  ww.  java 2 s .  c o m*/
public static void checkGLError(String label) {
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.e(TAG, label + ": glError " + error);
        throw new RuntimeException(label + ": glError " + error);
    }
}

From source file:Main.java

public static Bitmap getCompressedBitmap(String filePath, int sampleSize) {
    BitmapFactory.Options options = new BitmapFactory.Options();
    options.inSampleSize = sampleSize;//from www.  j  a  va  2 s  .  co m
    try {
        return BitmapFactory.decodeFile(filePath, options);
    } catch (OutOfMemoryError e) {
        Log.e("talktab.error", "OutOfMemoryError");
        options.inSampleSize = sampleSize * 2;
        return BitmapFactory.decodeFile(filePath, options);
    }
}

From source file:Main.java

public static boolean getBooleanPreferences(Context context, String name) {
    try {/*from  ww w.  j ava  2  s  .  c o m*/
        return context.getSharedPreferences(SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE).getBoolean(name,
                false);
    } catch (Exception e) {
        Log.e("datautils", e.getMessage());
        remove(context, name);
    }
    return false;
}

From source file:Main.java

public static String getICCID(Context context) {
    String iccid = "";
    try {/*from   w w  w .ja  v a  2 s .  c  o m*/
        TelephonyManager phoneManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        iccid = phoneManager.getSimSerialNumber();
    } catch (Exception e) {
        Log.e(TAG, "getIMEI error!");
        iccid = "";
    }
    if (iccid == null) {
        iccid = "";
    }
    return iccid;
}

From source file:Main.java

/**
 * Close a ByteArrayOutputStream passed in.
 *
 * @param stream - ByteArrayOutputStream to be closed.
 *//*w w  w  .j a  va  2s . c o m*/
public static void closeOutputStream(OutputStream stream, String tag) {
    if (stream != null) {
        try {
            stream.close();
        } catch (IOException e) {
            Log.e(tag, "Exception occured when closing ByteArrayOutputStream." + e);
        }
    }
}

From source file:Main.java

public static int loadShader(String vss, String fss) {
    int vshader = GLES20.glCreateShader(GLES20.GL_VERTEX_SHADER);
    GLES20.glShaderSource(vshader, vss);
    GLES20.glCompileShader(vshader);/*from ww w.ja  va  2  s. c  om*/
    int[] compiled = new int[1];
    GLES20.glGetShaderiv(vshader, GLES20.GL_COMPILE_STATUS, compiled, 0);
    if (compiled[0] == 0) {
        Log.e("Shader", "Could not compile vshader");
        Log.v("Shader", "Could not compile vshader:" + GLES20.glGetShaderInfoLog(vshader));
        GLES20.glDeleteShader(vshader);
        vshader = 0;
    }

    int fshader = GLES20.glCreateShader(GLES20.GL_FRAGMENT_SHADER);
    GLES20.glShaderSource(fshader, fss);
    GLES20.glCompileShader(fshader);
    GLES20.glGetShaderiv(fshader, GLES20.GL_COMPILE_STATUS, compiled, 0);
    if (compiled[0] == 0) {
        Log.e("Shader", "Could not compile fshader");
        Log.v("Shader", "Could not compile fshader:" + GLES20.glGetShaderInfoLog(fshader));
        GLES20.glDeleteShader(fshader);
        fshader = 0;
    }

    int program = GLES20.glCreateProgram();
    GLES20.glAttachShader(program, vshader);
    GLES20.glAttachShader(program, fshader);
    GLES20.glLinkProgram(program);

    return program;
}

From source file:Main.java

public static int getMiuiVersion() {
    String version = getSystemProperty("ro.miui.ui.version.name");
    if (version != null) {
        try {//  w w  w .j av a  2  s.c o m
            return Integer.parseInt(version.substring(1));
        } catch (Exception e) {
            Log.e(TAG, "get miui version code error, version : " + version);
        }
    }
    return -1;
}

From source file:Main.java

public static Date getDateFromString(String __date) {
    try {/*from  ww  w.ja v a2s  .c o  m*/
        return inputFormatter.parse(__date);
    } catch (ParseException e) {
        Log.e("LeverageDataUtils", "Impossible to parse date [" + __date + "]!");
        return null;
    }
    //      date = outputFormatter.format(inputFormatter.parse(pubDate));
}