List of usage examples for android.util Log v
public static int v(String tag, String msg)
From source file:Main.java
public static int getIntField(Object obj, String fieldName) { try {/* w w w. j av a2s.c o m*/ return findField(obj.getClass(), fieldName).getInt(obj); } catch (IllegalAccessException e) { // should not happen //XposedBridge.log(e); Log.v("test", e.getMessage()); throw new IllegalAccessError(e.getMessage()); } catch (IllegalArgumentException e) { throw e; } }
From source file:Main.java
public static InputStream readStreamFromFile(String fileName, Context context) { FileInputStream fis = null;/*from w w w . j av a 2 s . c o m*/ try { // First read the user agent from private memory fis = context.openFileInput(fileName);// listType as filename } catch (Exception exp) { Log.v(TAG, "GetMedia list lastupdated time - exp:" + exp.getMessage()); } return fis; }
From source file:Main.java
public static boolean isNetworkAvailable(Context context) { ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { Log.v(TAG, " ConnectivityManager: " + " " + "networkInfo.isConnected()"); return true; } else {/* w ww.j a v a2 s .c o m*/ Log.v(TAG, " ConnectivityManager: " + " " + "networkInfo = null"); return false; } }
From source file:Main.java
public static boolean checkConn(Context ctx) { ConnectivityManager conMgr = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); if (conMgr.getNetworkInfo(conMgr.TYPE_MOBILE).isConnectedOrConnecting() || conMgr.getNetworkInfo(conMgr.TYPE_WIFI).isConnectedOrConnecting()) { Log.v(TAG, "Able to connect to the network"); return true; } else {//from w w w. j a v a2s . com Log.e(TAG, "Unable to connect to network"); } return false; }
From source file:Main.java
static public boolean setPin(Class btClass, BluetoothDevice btDevice, String str) throws Exception { try {/*from w w w. j a va2 s.c o m*/ Method removeBondMethod = btClass.getDeclaredMethod("setPin", new Class[] { byte[].class }); Boolean returnValue = (Boolean) removeBondMethod.invoke(btDevice, new Object[] { str.getBytes() }); Log.v("tag", "++++++++++++" + returnValue); Log.e("returnValue", "" + returnValue); } catch (SecurityException e) { // throw new RuntimeException(e.getMessage()); e.printStackTrace(); } catch (IllegalArgumentException e) { // throw new RuntimeException(e.getMessage()); e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return true; }
From source file:Main.java
public static void checkPhoneSettings(Activity activity) { //Check if device supports bluetooth: if (mBluetoothAdapter == null) { //!TODO//www . j a v a 2 s. c om } else { Log.v("", "Bluetooth is supported"); //Check if bluetooth is enabled. If not, request the user to enable it. if (!mBluetoothAdapter.isEnabled()) { Log.v("", "Bluetooth is not turned on"); Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); activity.startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT); } else { deviceMAC = getMACAddress(); } } }
From source file:Main.java
public static boolean programValidated(int programId) { glValidateProgram(programId);// ww w . java 2s . c o m final int[] status = new int[1]; glGetProgramiv(programId, GL_VALIDATE_STATUS, status, 0); Log.v(TAG, "Validated: " + glGetProgramInfoLog(programId) + "end"); return status[0] != 0; }
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);// w ww.j ava2 s .c o m 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
/** * Converts time to a string, with the minute and seconds always appearing. * E.g. "0:01" or "0:59" or 5:33" or "23:59:59". * * @param milliseconds Time in milliseconds since start of meeting * @return String formatted time interval string in "H:MM:SS" format. *//* w w w.ja va 2 s .com*/ public static String timeToHMMSSMinuteMandatory(long milliseconds) { Log.v(TAG, "timeToHMMSS(" + milliseconds + ")"); int seconds = (int) (milliseconds % 60_000) / 1000; int minutes = (int) (milliseconds / 60_000) % 60; int hours = (int) (milliseconds / 3600_000); String hms = String.format(Locale.getDefault(), "%d:%02d", minutes, seconds); if (hours >= 1) { hms = String.format(Locale.getDefault(), "%d:%02d:%02d", hours, minutes, seconds); } return hms; }
From source file:Main.java
public static void writeMediaListLastUpdatedTimeToFile(Context context, String listType, String lastUpdatedTime) { // writing to internal private memory FileOutputStream fos = null;/* w w w . j a v a 2s . co m*/ try { fos = context.openFileOutput(listType, Context.MODE_PRIVATE); fos.write(lastUpdatedTime.getBytes()); fos.close(); Log.v(TAG, "Lastupdated time " + lastUpdatedTime + " successfully written to file for listType = " + listType); } catch (Exception exp) { Log.v(TAG, "Failed to write lastUpdated time. exp:" + exp.getMessage()); exp.printStackTrace(); } }