List of usage examples for android.util Log i
public static int i(String tag, String msg)
From source file:Main.java
public static void saveAlarmRecord(Context context) { SharedPreferences sh = context.getSharedPreferences("alarm_record", Activity.MODE_PRIVATE); int i = sh.getInt("alarmRecord", -1); Log.i(">>>>>>>>>>>>>", i + ">>>>>>>>"); sh.edit().putInt("alarmRecord", ++i).commit(); }
From source file:Main.java
public static void registerNewSourceSinkConnection(int counter, String taintInfoOfSource) { Log.i("PEP", "in registerNewSourceSinkConnection(int counter, String taintInfoOfSource)" + counter + " " + taintInfoOfSource);/*from w w w .j a v a 2s . c o m*/ Set<String> taintInfos = new HashSet<String>(); taintInfos.add(taintInfoOfSource); sourceSinkConnection.put(counter, taintInfos); }
From source file:Main.java
/** * Return the absolute path to the hub database. * * @return path The path to the db as a string *//*from w w w . j a v a2s.c o m*/ private static String getDbPath() { if (Debug) Log.i(TAG, "getDBPath() called."); String path = Environment.getExternalStorageDirectory().getPath() + "/" + BASE_DIR; File dbDir = new File(path); if (!dbDir.isDirectory()) { try { if (Debug) Log.i(TAG, "Trying to create " + path); dbDir.mkdirs(); } catch (Exception e) { final Writer result = new StringWriter(); final PrintWriter printWriter = new PrintWriter(result); e.printStackTrace(printWriter); Log.e(TAG, result.toString()); } } return path; }
From source file:Main.java
public static String parseHelpFile(String filename) { String output;//from www . j a v a2 s .c om InputStream is = null; try { is = assetFiles.open("txt/" + filename); output = readTextFile(is); } catch (IOException e) { output = "Sorry, help file not found."; Log.i("IO error", e.getMessage()); } return output; }
From source file:Main.java
public static boolean deleteFile(String fileName) { boolean status; SecurityManager checker = new SecurityManager(); if (!fileName.equals("")) { File path = Environment.getExternalStorageDirectory(); File newPath = new File(path.toString() + fileName); checker.checkDelete(newPath.toString()); if (newPath.isFile()) { try { Log.i("DirectoryManager deleteFile", fileName); newPath.delete();/*from w w w.j a va2s . co m*/ status = true; } catch (SecurityException se) { se.printStackTrace(); status = false; } } else status = false; } else status = false; return status; }
From source file:Main.java
/** * @brief log utility */ static private void log(String msg) { if (enableLog) Log.i(TAG, msg); }
From source file:Main.java
private static void removeGoogleAuthHeaders(HttpUriRequest request) { for (Header header : request.getAllHeaders()) { if (header.getName().equalsIgnoreCase("Authorization") && header.getValue().startsWith(AUTHORIZATION_HEADER_PREFIX)) { Log.i(LOG_TAG, "Removing header:" + header); request.removeHeader(header); }/*from ww w .j a v a 2 s . co m*/ } }
From source file:Main.java
public static boolean isRunningOnEmulator(Context context) { TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); String networkOperator = tm.getNetworkOperatorName(); Log.v(TAG, "Network operator is " + networkOperator); if (networkOperator.equals("Android")) { Log.i(TAG, "Running on emulator."); return true; }//from w w w . ja v a 2 s . c o m Log.i(TAG, "Running on real device."); return false; }
From source file:Main.java
static void fireScreenCaptureIntent(Activity activity) { MediaProjectionManager manager = (MediaProjectionManager) activity .getSystemService(Context.MEDIA_PROJECTION_SERVICE); Intent intent = manager.createScreenCaptureIntent(); activity.startActivityForResult(intent, CREATE_SCREENSHOT); Log.i("TakeScreenshotService", "fireScreenCaptureIntent..."); }
From source file:Main.java
public static void setCurrentRingerMode(Context context) { AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); if (audioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL) { currentMode = AudioManager.RINGER_MODE_NORMAL; currentVolume = audioManager.getStreamVolume(AudioManager.STREAM_RING); Log.i("Current Mode Normal", currentVolume + ""); Log.i("Vlaue of", currentMode + ""); } else if (audioManager.getRingerMode() == AudioManager.RINGER_MODE_VIBRATE) { currentMode = AudioManager.RINGER_MODE_VIBRATE; Log.i("Current Mode Vibrate", currentVolume + ""); Log.i("Vlaue of", currentMode + ""); } else if (audioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT) { currentMode = AudioManager.RINGER_MODE_SILENT; Log.i("Current Mode Silent", currentVolume + ""); Log.i("Vlaue of", currentMode + ""); } else {/* w w w . ja va 2 s . c o m*/ Log.i("Nothing ", "Matched above"); } }