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 PendingIntent scheduleLocalNotification(Context context, int slot, String title, String message,
        Long alertTime, int repeat) {
    Log.i(TAG, "Scheduling local notification");
    Intent alertIntent = new Intent(getNotificationName(slot));

    PendingIntent pendingIntent = PendingIntent.getBroadcast(context, slot, alertIntent,
            PendingIntent.FLAG_UPDATE_CURRENT);

    AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
    if (alarmManager != null) {
        if (repeat == 0) {
            alarmManager.set(AlarmManager.RTC_WAKEUP, alertTime, pendingIntent);
        } else {//w w w.  j  a  v a  2  s  .c o  m
            Calendar alarmStartTime = Calendar.getInstance();
            alarmStartTime.add(Calendar.MINUTE, 1);
            alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, alertTime, repeat, pendingIntent);
        }
    }
    return pendingIntent;
}

From source file:Main.java

/**
 * info log//from   ww w .j  a  v  a 2s .  c o m
 * @param tag tag
 * @param msg log msg
 */
public static void i(String tag, String msg) {
    if (LOG_ENABLE) {
        Log.i(tag, buildMsg(msg));
    }
}

From source file:Main.java

public static void i(String tag, String msg) {
    if (isDebug)
        Log.i(tag, msg);
}

From source file:Main.java

public static String buildBackDropPath(String backdrop_path) {
    Uri.Builder builder = new Uri.Builder();
    try {//from w w  w  .  ja  v a  2 s . co  m
        backdrop_path = backdrop_path.substring(1);
        Uri poster_uri = builder.scheme("https").authority("image.tmdb.org").appendPath("t").appendPath("p")
                .appendPath("w1000").appendPath(backdrop_path).build();
        return poster_uri.toString();
    } catch (Exception e) {
        Log.i("Letswatch", "An error occurred " + e);
    }
    return null;
}

From source file:Main.java

/**
 * Copies a file from res/raw to destination (typically context.getFilesDir())
 *///  w  w w.j a  v a 2  s.  c  o m
public static void copyInputFileStreamToFilesystem(InputStream in, String outputFilePathName)
        throws IOException {
    Log.i(TAG, "copyInputFileStreamToFilesystem() outputFilePathName: " + outputFilePathName);
    OutputStream out = new BufferedOutputStream(new FileOutputStream(outputFilePathName));
    byte[] buffer = new byte[4096];
    int len = in.read(buffer);
    while (len != -1) {
        out.write(buffer, 0, len);
        len = in.read(buffer);
    }
    out.close();
}

From source file:Main.java

public static void blur(Context context, Bitmap bkg, View view, int width, int height) {
    float radius = 20;
    Log.i("hulixia", bkg.getWidth() + "w,h" + bkg.getDensity());
    Bitmap overlay = Bitmap.createBitmap(bkg.getWidth(), bkg.getHeight(), Bitmap.Config.ARGB_8888);

    Canvas canvas = new Canvas(overlay);
    canvas.translate(-view.getLeft(), -view.getTop());
    canvas.drawBitmap(bkg, 0, 0, null);//from ww  w . j  a v a 2s.  c  om

    RenderScript rs = RenderScript.create(context);

    Allocation overlayAlloc = Allocation.createFromBitmap(rs, overlay);
    ScriptIntrinsicBlur blur = ScriptIntrinsicBlur.create(rs, overlayAlloc.getElement());
    blur.setInput(overlayAlloc);
    blur.setRadius(radius);
    blur.forEach(overlayAlloc);
    overlayAlloc.copyTo(overlay);
    view.setBackground(new BitmapDrawable(context.getResources(), overlay));
    rs.destroy();
}

From source file:Main.java

public static boolean isBefore(Calendar currentCalendar, Calendar max) {
    int currentYear = currentCalendar.get(Calendar.YEAR);
    int currentMonth = currentCalendar.get(Calendar.MONTH);
    int currentDay = currentCalendar.get(Calendar.DAY_OF_MONTH);
    int maxYear = max.get(Calendar.YEAR);
    int maxMonth = max.get(Calendar.MONTH);
    int maxDay = max.get(Calendar.DAY_OF_MONTH);
    Log.i("TAG",
            (currentYear <= maxYear && currentMonth <= maxMonth && currentDay <= maxDay) + "currentYear"
                    + currentYear + "maxYear" + maxYear + "currentMonth" + currentMonth + "maxMonth" + maxMonth
                    + "currentDay" + currentDay + "maxDay" + maxDay);
    return (currentYear == maxYear)
            ? ((currentMonth == currentMonth) ? (currentDay < maxDay) : (currentMonth < maxMonth))
            : (currentYear < maxYear);
}

From source file:Main.java

public static final boolean deleteFolder(String path) {
    // not recursive
    if (path != null && storageReady()) {
        File dir = new File(path);
        if (dir.exists() && dir.isDirectory()) {
            File[] files = dir.listFiles();
            for (File file : files) {
                if (!file.delete()) {
                    Log.i(tag, "Failed to delete " + file);
                }/*from w  ww .  j a v a  2s  . c  o  m*/
            }
        }
        return dir.delete();
    } else {
        return false;
    }
}

From source file:Main.java

public static void addPhotoToMediaStoreSynchronously(Context context, Uri uri) {
    MediaScannerConnection.scanFile(context, new String[] { uri.getPath() }, new String[] { "image/*" },
            new MediaScannerConnection.OnScanCompletedListener() {
                public void onScanCompleted(String path, Uri uri) {
                    Log.i("MediaStore", "Scanned " + path + ":");
                    Log.i("MediaStore", "-> uri=" + uri);
                }//from w w  w.j  a va 2s  .  co  m
            });
}

From source file:Main.java

public static void registerNewSourceSinkConnection(int counter, String taintInfoOfSource) {
    Log.i("PEP", "in registerNewSourceSinkConnection(int counter, String taintInfoOfSource)");
    Set<String> taintInfos = new HashSet<String>();
    taintInfos.add(taintInfoOfSource);//from   w  ww  . j a v a 2s . com
    sourceSinkConnection.put(counter, taintInfos);
}