Android Question Completely stable service


New Member
Hello everyone
I need a completely stable service to run the alarms and call the call to prayer at the right time.
I tried a lot and tried the content of the site many times. I have encountered many problems. I also saw an example that took the coordinates and displayed it in the notifications. I do not want to display the notification forever in the notifications section because it is annoying, I just want the service to run and request work at the appointed time that I set with the alarm manager To do.

Sometimes the service does its job outside the software, but sometimes it does not.
Sometimes the service comes back to life after the device is turned off and on, but sometimes it does not.
When the screen is off, sometimes the service does its job, but most of the time when the screen is turned on, the requested tasks are displayed one after the other, and this is bad.
I tried many accesses and did a lot of work, but to no avail.

- Using the available access and function, I got rid of the software from battery optimization.
- In some phones, the boot starter does not work, so I directed the user to the settings to manually activate the boot starter.
- In the phone settings> Software information> Other permissions, there are 2 permissions (usually on Xiaomi phones); I also activated them manually, but still the problem is not solved and the service is not run outside the software or with Delay runs or does not run if the screen is off.

Please, if your friends have a standard or reliable source or method in this field, it is very, very necessary.
Sorry it took too long.


New Member
The solution is to use StartServiceAtExact. Will it work perfectly on all devices? No. Many devices enforce all kinds of limitations on apps that try to run in the background. In some cases the user can whitelist the app.
Does the use of StartServiceAtExact not put pressure on the device?

The current problem is that when an alarm is set (this problem is currently seen on Xiaomi), when the screen is locked, the alarm goes off or runs late, or after rebooting, it either runs or runs late. As you said, this Problems solved?
Hi dear @Erel.
Those who programming the app alarms. How can they use the service with restrictions?
If someone wants to write an alarms app, how can they cross the restrictions?