Android.App.AlarmManager.SetWindow Method
Schedule an alarm to be delivered within a given window of time.

Syntax

[Android.Runtime.Register("setWindow", "(IJJLandroid/app/PendingIntent;)V", "GetSetWindow_IJJLandroid_app_PendingIntent_Handler")]
public virtual void SetWindow ([Android.Runtime.GeneratedEnum] AlarmType type, long windowStartMillis, long windowLengthMillis, PendingIntent operation)

See Also

AlarmManager.Set(AlarmType, System.Int64, System.Int64)
AlarmManager.SetExact(AlarmType, System.Int64, System.Int64)
AlarmManager.SetRepeating(AlarmType, System.Int64, System.Int64, System.Int64)
AlarmManager.Cancel(PendingIntent)
Android.Content.Context.SendBroadcast(Android.Content.Intent)
Android.Content.Context.RegisterReceiver(Android.Content.BroadcastReceiver, Android.Content.IntentFilter)
Android.Content.Intent.FilterEquals(Android.Content.Intent)

Parameters

type
One of AlarmManager.ELAPSED_REALTIME, AlarmManager.ELAPSED_REALTIME_WAKEUP, AlarmManager.RTC, or AlarmManager.RTC_WAKEUP.
windowStartMillis
The earliest time, in milliseconds, that the alarm should be delivered, expressed in the appropriate clock's units (depending on the alarm type).
windowLengthMillis
The length of the requested delivery window, in milliseconds. The alarm will be delivered no later than this many milliseconds after windowStartMillis. Note that this parameter is a duration, not the timestamp of the end of the window.
operation
Action to perform when the alarm goes off; typically comes from PendingIntent.GetBroadcast(Android.Content.Context, System.Int32, System.Int32, System.Int32).

Remarks

Schedule an alarm to be delivered within a given window of time. This method is similar to AlarmManager.Set(AlarmType, System.Int64, System.Int64), but allows the application to precisely control the degree to which its delivery might be adjusted by the OS. This method allows an application to take advantage of the battery optimizations that arise from delivery batching even when it has modest timeliness requirements for its alarms.

This method can also be used to achieve strict ordering guarantees among multiple alarms by ensuring that the windows requested for each alarm do not intersect.

When precise delivery is not required, applications should use the standard AlarmManager.Set(AlarmType, System.Int64, System.Int64) method. This will give the OS the most flexibility to minimize wakeups and battery use. For alarms that must be delivered at precisely-specified times with no acceptable variation, applications can use AlarmManager.SetExact(AlarmType, System.Int64, System.Int64).

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1