I have a few questions regarding the WakefulIntentService implementation by CWAC:
1) Is it safe to use multiple WakefulIntentServices at the same time within my application?
2) Is it still ok to use my own code that handles AlarmManager? This would save me re-implementing my alarm handling code. Currently, I have a class with static methods and variables which are used by other classes within the application to set the alarm. My AlarmReceiver then starts the WakefulIntentServices by classing doWakefulWork().
This class is fantastic work!
Thanks
You should only need one. Use different
Intentinformation (e.g., actions, extras) to distinguish the different commands.I have not tried multiple distinct services — while it is possible that it will work, I cannot guarantee it.
Oh, sure. Follow the “Basic Usage” instructions, calling
sendWakefulWork()onWakefulIntentServicewhen you want the work to be done. Just bear in mind that you must do that from aBroadcastReceiver'sonReceive()ifAlarmManageris the trigger — that’s anAlarmManagerrequirement.I am glad that you like it!