Android Utililty Methods Alarm Create

List of utility methods to do Alarm Create

Description

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

Method

voidcreateRepeatingAlarm(Context context, Class clazz, int intervalInMs, int flags)
create Repeating Alarm
AlarmManager alarmManager = (AlarmManager) context
        .getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(context, clazz);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context,
        0, intent, flags);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,
        System.currentTimeMillis(), intervalInMs, pendingIntent);
voidbuildAlertMessageNoGps(final Context context)
public static void buildAlertMessageNoGps(final Context context)

This method will prompt a dialog box and it will redirect to settings from where user can enable GPS functionality
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage(
        "Your GPS seems to be disabled, do you want to enable it? With GPS we can track you more accurately")
        .setCancelable(false)
        .setPositiveButton("Enable GPS",
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(
...