java - AlarmManager alternatives for persistent frequent scheduling -
it has come attention android 5.1 no longer accepts recurring alarms time intervals shorter 60 seconds (source).
i developing application logs information wireless networks. operation of application imperative can perform operations every 1-2 seconds , doesn't killed or suspended operating system if using lot of resources. reliable operation on long periods of time (several hours) important thing. impact on battery life not concern.
so far reliable way of achieving functionality has been use recurring alarms. android 5.1 no longer option. best options replacing alarmmanager implementation?
as workaround can set 60 alarms flexible solution current implementation. check os version , set many alarms need.
but long-term solution suggest implement sticky foreground service work similar music player. simple handler.postdelayed should enough keep alive. reason way alarms not accurate , better have control on process.
Comments
Post a Comment