Wake locks android service recurring

前端 未结 3 1833
春和景丽
春和景丽 2020-12-05 03:27

I have this application that needs to run a service (background) that beeps periodically. The phone needs to beep the entire day for 5 seconds every one minute (used a hand

3条回答
  •  被撕碎了的回忆
    2020-12-05 04:05

    Follow the pattern Mark Murphy provides with the WakefulIntentService. I would suggest picking up his books, not only for the detailed explanation of this class and example he includes in one of them, but for the other wealth of information you'll find in them.

    I just recently implemented this pattern for my main app and this class works like a charm.

提交回复
热议问题