i am new to android i have to perform some operation after every 30 min whether my application is running or not so i want to how to perform these operation using service and alarm manager any example or running will be helpfull
Real-time clock (RTC) alarms are clock-based alarms that use Coordinated Universal Time (UTC). Only choose an RTC alarm in these types of situations: You need your alarm to fire at a particular time of day. The alarm time is dependent on current locale.
RTC_WAKEUP and ELAPSED_REALTIME_WAKEUP will wake up the device out of sleep mode. If your PendingIntent is a broadcast PendingIntent , Android will keep the device awake long enough for onReceive() to complete.
To access the alarms, tap the alarm icon at the top of the screen. To add a new alarm, tap the plus icon button at the bottom of the screen. This button can be used to add multiple alarms. To set the time for the alarm, tap the hour on the time on the left and then tap the hour on the clock on the right.
Use RTC_WAKEUP if you want your service to perform some operation every 30 min as RTC_WAKEUP will wake the device up and deliver the pending intent. On the other hand RTC will deliver the intent only when the device wakes up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With