简体   繁体   中英

Repeating operation in Android without alarm manager

I created application for sending sms interval. I used AlarmManager, which worked good, however after few days of proper working (send SMS at established time). It starts sending at different time or desist. As far as I know, this is often problem with AlarmManager. Is there some trap with AM ? or maybe you know better solution, library for that type of problem?

Thanks in advance

if the interval of time for sending the email is more than 15 minutes, I suggest you to use JobScheduler . That work really good over all android versions. I mentioned more than 15 mins because JobScheduler only can schedule at least every 15 mins on android 7 and over.

JobScheduler is an option, but this is only available on Android API Level 21+ (Lollipop v5.0).
A better option is to use WorkManager , currently in beta, that provides the same functionality (and limits like the mentioned 15 minutes minimum interval) but down to API level 14.

You can find more information about WorkManager on this series of blogs and on the documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM