I want to start the alarm service every second in my application. It works fine under version 5.1. but it does not start on 5.1 devices. I use commonsware service wake intention. A logcat report says, "A suspiciously short interval of 1000 milliseconds expanding to 60 seconds ." How can I interrogate every second in 5.1? Can anyone suggest me how to do this?
The explanation is a bit more:
My use case is that I need to perform some operation every 30 minutes. AFAIK For this Using Alarm Manager is an effective way, but here
1) I need to display a countdown timer for the user. (Timer task, countdown timer, ScheduledExecutorService is very useful for this)
2) I need to notify the user every 30 minutes (via notification), even if the application is in the background (Alarm Service is enough for this)
but my problem here is that the application is in the background, when you delete the application from retentates (i.e. the application process is killed), none of the services or timers, handlers, executing services will work). In this case, how can I notify the user after 30 minutes. Please guide me if I am wrong.
Thanks,
Chaitanya
android alarmmanager android-wake-lock background-service
Chaitu
source share