AlarmManager


 

  1. AlarmManager OneTimeShot
  2. AlarmManager Repeating

 

1. AlarmManager OneTimeShot
Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create “Blank Activity” and click “Finish” button.
Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open src -> package -> Create a new class, AlarmManagerBroadcastReceiver.java and add following code :

Step 5 : Open AndroidManifest.xml and add following code :

Screenshots:

alarmoneshot alarmoneshot2

Download_button

 

2. AlarmManager Repeating
Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create “Blank Activity” and click “Finish” button.
Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open src -> package -> Create new class, AlarmManagerBroadcastReceiver.java and add following code :

Step 5 : Open AndroidManifest.xml and add following code :

Screenshots:

alarmrepeate alarmrepeate2 alarmrepeate3

Download_button