This maybe a repeated question here but I'm still facing issues on this, hope there's a solution around. Thanks in advance.
How do I set the alarm manager to run so as to execute the function specifically at every 15 minutes clock interval, for example 8:00, 8:15, 8:30, 8:45, 9:00 everyday regardless of the time when the application is started.
Take an example if let's say I started my application main activity at 7:47, and I would like the alarm to start at 8:00, followed along with 8:15, 8:30 and etc....how should I do? I would really appreciate if any suggestions are given..
Better to set an alarm clock for every time you want with one day interval
Here
yourTimeInMillisecond
is the time you want to set alarm, like if you want to set alarm for tomorrow 9 am then it will be :Hope it will work for you :)
you should setup two alarm manager.for the first one set trigger time by calculating the remain time to your appropriate time (for example 8:00 Am). and after that you should create another alarm manager inside of your first alarm manager that will trigger each 15 minutes.
for calculate time for set first alarm manager use the code bellow:
Edit
and after that you can use code bellow to setup first alarm manager:
so now in your FirstReceiver class do something like bellow: