If you need something to be running on a fine grained interval (< once a few minutes), I think it should morally be in the foreground. Yes, forgrounded apps can be killed off eventually: hence the necessity of using an AlarmManager at times. That being said, in my mind the use of an AlarmManager is for things that run "once in a while" and not things that run "constantly". Again, not saying you are wrong, Piren, just a touchy spot of the scheduler. (To be fair, the scheduler's policy tends to killing everlasting services, which should be the strange exception, rather than the norm.)
Kris On Tue, Apr 23, 2013 at 10:52 AM, Piren <[email protected]> wrote: > Well, if the need is for something that will continue running even when the > app isn't in the foreground/running, nothing will work except for the > alarmmanager. > > > On Tuesday, April 23, 2013 5:26:15 PM UTC+3, Kristopher Micinski wrote: >> >> I had sort of assumed that this was the same as in the other thread... >> In which case using an AlarmManager would be inappropriate (though, >> perhaps I assumed incorrectly..!). AlarmManager has a coarse >> scheduling granularity (minutes, rather than seconds), and I've always >> felt an aversion for using it for this purpose. >> >> *sigh*, however sometimes it does seem to be a necessary solution to >> get the desired effect.. >> >> Kris >> >> On Tue, Apr 23, 2013 at 10:12 AM, Piren <[email protected]> wrote: >> > that's not how you're supposed to do what you want... >> > To achieve such things, use the AlarmManager. >> > >> > http://developer.android.com/reference/android/app/AlarmManager.html >> > >> > >> > On Tuesday, April 23, 2013 2:22:57 PM UTC+3, Turim wrote: >> >> >> >> I am developing a simple GPS tracker. But i have a problem. When starts >> >> the Service, i create a Thread that get de localization, time after >> >> time. >> >> The problem is after long time (about hours), the Thread is stoped. I >> >> dont >> >> know why. >> >> >> >> >> >> How do i create a service/thread long time. I need that thread never >> >> stopped, or the service be recreated. >> >> >> >> Anybody help me ? >> >> >> >> >> >> Thanks. >> > >> > -- >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "Android Developers" group. >> > To post to this group, send email to [email protected] >> > To unsubscribe from this group, send email to >> > [email protected] >> > For more options, visit this group at >> > http://groups.google.com/group/android-developers?hl=en >> > --- >> > 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]. >> > For more options, visit https://groups.google.com/groups/opt_out. >> > >> > > > -- > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > --- > 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]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- 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]. For more options, visit https://groups.google.com/groups/opt_out.

