List of usage examples for android.util Log e
public static int e(String tag, String msg)
From source file:Main.java
public static Bitmap zoomBitmap(Bitmap bitmap, float scale) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); Log.e("ss", "width=" + width); Log.e("ss", "height=" + height); Matrix matrix = new Matrix(); //float scaleWidht = ((float)w / width); //float scaleHeight = ((float)h / height); matrix.postScale(scale, scale);/* ww w. ja v a 2 s . c o m*/ Bitmap newbmp = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true); return newbmp; }
From source file:Main.java
public static short hasAEStartIndex(byte[] data) { short count = 0; for (int i = 0; i < data.length; i++) { if (data[i] == (byte) 0xAE) { count++;/*from w w w . j ava2 s . c o m*/ } } Log.e("BMSUtil", "contain the starting index header (count):" + count); return count; }
From source file:Main.java
public static Bitmap getCanvasBitmap(Bitmap bm, int width, int height) { int w = bm.getWidth(); int h = bm.getHeight(); if (w < width || h < height) { Log.e("bitmaputils", "bitmap target size is not "); return bm; }//from w w w .j a v a 2 s. c o m Bitmap bitmap = Bitmap.createBitmap(bm, (w - width) / 2, (h - height) / 2, width, height); return bitmap; }
From source file:Main.java
public static boolean isNetworkAvailable(Context context) { if (context == null) { Log.e("isNetworkAvailable", " Context is null"); return false; }/*w w w.ja v a 2 s.c om*/ try { ConnectivityManager connectivity = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); if (connectivity != null) { NetworkInfo info = connectivity.getActiveNetworkInfo(); return info.isAvailable(); } } catch (Exception e) { return false; } return false; }
From source file:Main.java
public static boolean createDirIfNotExists(String path) { boolean ret = true; File file = new File(path); if (!file.exists()) { if (!file.mkdirs()) { Log.e("TravellerLog :: ", "Problem creating Image folder"); ret = false;/* ww w . j ava 2s . c o m*/ } } return ret; }
From source file:Main.java
public static Class<?> getR_ID_Class(Context context) { try {/*from ww w . j a va2 s. c o m*/ return Class.forName(context.getPackageName() + ".R$id"); } catch (ClassNotFoundException e) { Log.e("TAG", e.getMessage()); } return null; }
From source file:Main.java
public static void checkGlError(String op) { int error;// ww w. ja va 2 s . c o m while ((error = glGetError()) != GL_NO_ERROR) { Log.e("ES20_ERROR", op + ": glError " + error); throw new RuntimeException(op + ": glError " + error); } }
From source file:Main.java
public static String split(String str, String delimiter, int idx) { String retStr = ""; try {/*from w w w . j a v a 2 s . co m*/ String[] arr = str.split(delimiter); retStr = arr[idx]; } catch (Exception e) { Log.e("SHUtil.split", e.getMessage()); } return retStr; }
From source file:Main.java
public static void checkGLError(String op) { for (int error = GLES20.glGetError(); error != 0; error = GLES20.glGetError()) Log.e(LOGTAG, "After operation " + op + " got glError 0x" + Integer.toHexString(error)); }
From source file:Main.java
private static void closeInputStream(InputStream in) { if (null != in) { try {//ww w . j a va 2s. c om in.close(); } catch (IOException e) { Log.e("BitMapUtil", "closeInputStream==" + e.toString()); } } }