I was trying to build an android alarm app, and the way I implemented it was that I created a service in which first I search in the list for the closest alarm that should blow