I\'m trying to create an alarm based application. I\'m using AlarmManager
. The thing is that it\'s not reliable at all. In some devices it works.. in other devi
In addition to marcin´s answer, another reason could be a build in task-manager/energy-manager. If you write, your alarm works fine on some devices and in some not, it could be because of lower/higher APIs like Marcin suggested. But there is another thing that I have explored on my Huawei Ascend Mate 7: Some devices have an energy control system inside that directly closes the application completely after screen goes off. I had the same problem with one of my apps with an alarm manager and nothing helped, wether a usual service nor a foreground service nor any other programming solution. It was just simple: I had to go to settings-->energy saving mode-->protected apps
. Here you have to enable the protection of your app.
It may be that this is not the solution in Your case, but it is in much other devices and this explanation is too long for a comment, so I have to put it as answer.