Hi. I need a background task to run every minute. I have no need for a user 
interface, although I understand that I must still declare a launcher 
activity, which I can just finish() once I've set up my service.

I'm confused between the use of AlarmManager, Receivers and Services. So 
far, I've scheduled a repeating alarm, which passes a class called 
AlarmReceiver in its Intent. AlarmReceiver extends BroadcastReceiver, and 
the onReceive() method successfully fires every minute, even if I kill the 
activity, which is exactly what I want.

However, at no point am I using a class which extends Service or 
IntentService, which when I look around at other people's examples, seems 
to be what everyone does when they want a task to run as a background 
service. Am I doing something wrong? Should I be calling a Service class 
from my BroadcastReceiver instead of doing the work there?

Many thanks for any advice.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/52213af9-f4c9-4508-bbd0-3791e8fdec92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to