Hi Guys, Thanks for your inputs. I have one more question. Before I ask, here is in brief, about what I'm doing. I'm working on a research project in a university and we are trying to find out the mobile users' context information. For this, we need to sense the users' environment. So, the basic working of the service is as follows:
- Initialise on start : register call backs using Intent filters, SensorManager and other System services - The main thread sleeps for about 15 mins, wakes up collects info from diff. classes and sends to a server. (i'm using the Java Timer class to do this) Now, my question is : Will using the timer class, have the same effect as using the AlarmManager ? or will it consume more resources. Also, it would be great if someone can suggest better way of achieving what I'm doing. -- Cheers, ~Tejas On Thu, Jun 10, 2010 at 5:46 PM, Dianne Hackborn <hack...@android.com>wrote: > Also note we are getting increasingly hard-core on such services. In > Eclair I think we tweaked things so that a long-running services' process > will eventually get moved from the "service" bucket to "background," to > basically guarantee it eventually gets killed (and the service restarted a > little while later). > > Also since these services tend to be one of our more significant causes of > poorly behaving devices, we are iteratively working on making them visible > to the user so they can blame the correct apps, and I'd like to also have a > way for users to report them to developers through the feedback mechanism. > I was also thinking of having a button the user could press to really > easily jump to market to rate the app. ;) > > > On Thu, Jun 10, 2010 at 1:46 PM, Mark Murphy <mmur...@commonsware.com>wrote: > >> keyeslabs wrote: >> > If you have a very good reason for doing so (one that you're willing >> > to defend to users and the likes of Mark) then you can force the >> > service to have the same priority as an activity use setForeground. >> > The caveat is that you must keep a notification visible for your >> > service. >> >> Note that it is startForeground() as of Android 2.0. >> >> You wouldn't typically use that for a boot-time, try-to-be-everlasting >> service, though. >> >> Having an activity starting and stopping a service, using >> startForeground() and a Notification, is a truly delightful pattern. >> >> I just cringe when developers try making services last forever, >> particularly starting at boot. It is development anti-patterns like >> everlasting services that cause all those industry pundits to say you >> need to use task killers to have your Android devices run well. >> >> As with many anti-patterns, there are spots for which everlasting >> services are valid (e.g., VOIP client waiting on a socket for an >> incoming call). But those are the exception, not the rule. >> >> That's why I boo. >> >> -- >> Mark Murphy (a Commons Guy) >> http://commonsware.com | http://github.com/commonsguy >> http://commonsware.com/blog | http://twitter.com/commonsguy >> >> Android Consulting: http://commonsware.com/consulting >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > > > -- > Dianne Hackborn > Android framework engineer > hack...@android.com > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > 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 post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en