Android Utililty Methods Alarm Get

List of utility methods to do Alarm Get

Description

The list of methods to do Alarm Get are organized into topic(s).

Method

longgetNextAlarmTimeSpan(String time)
get Next Alarm Time Span
calendar.clear();
calendar.setTime(parseDate(time));
return (calendar.getTimeInMillis() - System.currentTimeMillis()) / 1000; 
AlarmManagergetAlarmManager(Context ctx)
get Alarm Manager
return (AlarmManager) ctx.getSystemService(Context.ALARM_SERVICE);
AlarmManagergetAlarmManager(Context context)
get Alarm Manager
return (AlarmManager) context
        .getSystemService(Context.ALARM_SERVICE);
UrigetDefaultAlarmUri()
get Default Alarm Uri
try {
    Field f = Settings.System.class
            .getField("DEFAULT_ALARM_ALERT_URI");
    return (Uri) f.get(null);
} catch (Exception e) {
    return Settings.System.DEFAULT_NOTIFICATION_URI;
UrigetDefaultAlarmUri()
get Default Alarm Uri
try {
    Field f = Settings.System.class
            .getField("DEFAULT_ALARM_ALERT_URI");
    return (Uri) f.get(null);
} catch (Exception e) {
    return Settings.System.DEFAULT_NOTIFICATION_URI;
CalendargetNextAlarmTimeAbsolute(int hourOfDay, int minute)
get Next Alarm Time Absolute
Calendar cal = Calendar.getInstance();
Calendar calNow = (Calendar) cal.clone();
cal.set(Calendar.HOUR_OF_DAY, hourOfDay);
cal.set(Calendar.MINUTE, minute);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
if (cal.compareTo(calNow) <= 0) {
    cal.add(Calendar.DATE, 1);
...
DialoggetAlertDialog(Context context, String title, String message, String okText, DialogInterface.OnClickListener onClickOK)
get Alert Dialog
return getConfirmDialog(context, title, message, okText, onClickOK,
        null, null);