Android Alarm With Notification Tutorial in Android

In this I will show you how to design your own android alarm clock. It is used to run any application. For Example you can use it as an alarm i.e wakes you up when you are sleeping or in some other application. An Intent is used with AlarmManger.

There are four types of alarm

  1. ELAPSED_REALTIME
  2. ELAPSED_REALTIME_WAKEUP
  3. RTC
  4. RTC_WAKEUP

Creating User Interface

android alarm

  • Create new layout activity_main.xml

 

Building Android Application

  • Add AlarmService.java which will be invoked by broadcast Receiver. Add the following code.

  • Add AlarmReceiver.java this invoke when particular event occurs i.e in our case it will invoke when our set alarm time matches the current time.

  • Add MainActivity.java that used to set alarm.

  • Add the permissions and define receiver and service in AndroidManifest.xml.

  • Now your alarm android application is ready.

android alarm  android alarm  android alarm

That’s all my friends if you have any query then do let me know by commenting below and would be happy to help you.

8 thoughts on “Android Alarm With Notification Tutorial in Android”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.