List of usage examples for android.util Log d
public static int d(String tag, String msg)
From source file:Main.java
public static void printExtras(Intent i) { if (i == null) { return;/*from www. j a v a2 s. c o m*/ } Bundle bundle = i.getExtras(); if (bundle == null) { return; } Log.d("INTENT_EXTRAS", "++++ Printing extras: +++"); for (String key : bundle.keySet()) { Object value = bundle.get(key); Log.d("INTENT_EXTRAS", String.format("%s %s (%s)", key, value.toString(), value.getClass().getName())); } }
From source file:Main.java
public static int getPxToDp(Context con, int px) { float density = 0.0f; density = con.getResources().getDisplayMetrics().density; Log.d(TAG, "density = " + density); return (int) (px / density); }
From source file:Main.java
public static boolean existCache(String filename) { File file = new File(sAppContext.getCacheDir().getPath() + filename); Log.d("HR", file.exists() ? filename + ":EXIST" : filename + ":NOT EXIST"); return file.exists(); }
From source file:Main.java
/** * Logging: we do this way so we can ./adb logcat -s MagicMode:* * @param s//w w w . ja va 2s. co m */ static public void d(String s) { if (DEBUG_STATHI == true) Log.d(TAG, s); }
From source file:Main.java
public static String getAuditoryStage2SubDir(Context ctx, String subPath) { String fullPath = getStoragePath("/auditory" + "/stage2" + "/" + subPath, ctx); Log.d("fullPath", fullPath); return fullPath; }
From source file:Main.java
public static double roundTwoDecimals(double d) { try {//from www .j a v a 2s. c o m DecimalFormat twoDForm = new DecimalFormat("#.##"); return Double.valueOf(twoDForm.format(d)); } catch (NumberFormatException nfe) { Log.d("nfe", nfe.toString()); try { int i = (int) (d * 100); d = (i / 100); return d; } catch (NumberFormatException ne) { return d; } } }
From source file:Main.java
public static int RGBToColor(final double pRed, final double pGreen, final double pBlue) { Log.d("ColorUtils", "Before Scan= " + pRed + ", " + pGreen + " , " + pBlue); return Color.rgb(normalizeDouble(pRed), normalizeDouble(pGreen), normalizeDouble(pBlue)); }
From source file:Main.java
public static void execCmd(String szCmd, boolean bCatchLog) { try {/*from www. j a v a 2 s . c o m*/ Log.d("PvTorrent_proc", "execCmd=" + szCmd); Runtime runtime = Runtime.getRuntime(); Process process = runtime.exec(szCmd); if (bCatchLog) { InputStream is = process.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line = null; while (null != (line = br.readLine())) { Log.e("PvTorrent_proc", line); } } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block Log.d("PvTorrent_proc", e.toString()); } }
From source file:Main.java
public static void inspectEvent(MotionEvent e) { if (e == null) return;//from w ww. j av a 2 s . c o m final int pointerCount = e.getPointerCount(); Log.d(TAG, "Input: event time: " + e.getEventTime()); for (int p = 0; p < pointerCount; p++) { Log.d(TAG, "Input: pointer:" + e.getPointerId(p) + " x:" + e.getX(p) + " y:" + e.getY(p) + " action:" + e.getAction()); } }
From source file:Main.java
public static void d(String message) { if (!isLog) { return;//from w w w . j a v a 2 s . c o m } Log.d("CommonTool", message); }