I
I
ilnazoon2015-05-12 16:38:22
Android
ilnazoon, 2015-05-12 16:38:22

How to program a normal alarm?

Wanted to program an alarm clock. Started to develop, used AlarmManager to implement an alarm clock. AlarmManager was set when adding an alarm (one-time). When the call time was reached, the AlarmManager launched the broadcast receiver, and it, in turn, launched the service in which the main action took place (i.e. the call itself). Everything was fine. But when a reusable alarm was set, he called every other time.
Then, I radically changed the approach: I put an IntentService in the foreground, which checked in a loop which alarm should ring. Everything worked. But ... The battery began to melt before our eyes.
Actually, the question is: how to make both the alarm clock work and the battery live?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question