Example usage for android.util Log i

List of usage examples for android.util Log i

Introduction

In this page you can find the example usage for android.util Log i.

Prototype

public static int i(String tag, String msg) 

Source Link

Document

Send an #INFO log message.

Usage

From source file:Main.java

public static void i(String tag, String msg) {
    if (IS_DEBUG) {
        Log.i(tag, "-->" + msg);
    }
}

From source file:Main.java

static private void log(String format, Object arg1) {
    Log.i(TAG, String.format(format, arg1));
}

From source file:Main.java

public static Location chooseBetterLocation(Location location1, Location location2) {
    if (location1 != null) {
        Log.i(TAG, "Location1 : Lat: " + location1.getLatitude() + " Lng: " + location1.getLongitude());
    } else {/*  ww w.  j  a v a 2  s .co m*/
        Log.d(TAG, "Location1 is null!");
        return location2;
    }
    if (location2 != null) {
        Log.i(TAG, "Location2 : Lat: " + location2.getLatitude() + " Lng: " + location2.getLongitude());
    } else {
        Log.d(TAG, "Location2 is null!");
        return location1;
    }

    if (location1.getTime() > location2.getTime()) {
        return chooseTimeOrderedLocation(location1, location2);
    } else {
        return chooseTimeOrderedLocation(location2, location1);
    }
}

From source file:Main.java

public static boolean displayNetworkStatus(LocationManager locManager) {
    boolean ntw_enabled = false;
    try {/*from   ww  w.j  a  v a  2  s  . com*/
        ntw_enabled = locManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
    } catch (Exception ex) {
        Log.i("NetworkStatus", "checking NetworkStatus throws error " + ex);
    }
    return ntw_enabled;
}

From source file:Main.java

public static void i(String cusPreLogStr, String logStr) {
    Log.i(TAG, cusPreLogStr + logStr);
}

From source file:Main.java

public static int getCentWidthByView(View view) {

    final int mMeasuredWidth = View.MeasureSpec.getSize(view.getMeasuredWidth());

    Log.i("width", "mywidth--" + mMeasuredWidth);

    final int mWidth = View.MeasureSpec.getSize(view.getWidth());

    Log.i("width", "mywidth--" + mWidth);

    return (int) ((float) mWidth / 2 + 0.5f);

}

From source file:Main.java

/**
 * Get a random number within a given upper limit;
 *///  ww w .  j ava 2  s.c o  m
public static int getRandomInt(int max) throws Exception {
    int ret;
    Random r = new Random();
    ret = r.nextInt(max);

    Log.i(TAG, String.format("Generate an integer value: %d", ret));

    return ret;
}

From source file:Main.java

private static void addGoogleAuthHeader(HttpUriRequest request, String token) {
    if (token != null) {
        Log.i(LOG_TAG, "adding auth token token: " + token);
        request.addHeader("Authorization", AUTHORIZATION_HEADER_PREFIX + token);
    }//from w w  w .  j  a  v  a  2 s. c  o  m
}

From source file:Main.java

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

From source file:Main.java

private static int getOrientationFromExif(Uri imageUri, Context context) {
    int orientation = -1;
    Log.i("Photo Editor", "imageUri = " + imageUri);
    // File imageFile = new File(getRealPathFromUri(imageUri, context));
    File imageFile = new File(imageUri.getPath());
    try {/*from w  w w  .  j a v a 2 s. c o  m*/
        ExifInterface exif;
        Log.i("Photo Editor", "imageFile.getAbsolutePath() = " + imageFile.getAbsolutePath());
        exif = new ExifInterface(imageFile.getAbsolutePath());
        orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
    } catch (IOException e) {
        e.printStackTrace();
    }
    return orientation;
}