Hi Diane, What's the definition of "background" in terms this scheduling mode in Android 1.6 or later? Is it based on this document? http://developer.android.com/intl/fr/guide/topics/fundamentals.html#proclife
The follow up question is: if a service is a foreground service (e.g. has called startForeground()), will it consume more CPU than a service that has not? Thanks, Carter On Dec 16 2009, 6:33 pm, Dianne Hackborn <hack...@android.com> wrote: > You should be nice. As of 1.6, processes running in the background have > their threads forced into a background scheduling class so they can't > disrupt the foreground UI. > > On Wed, Dec 16, 2009 at 3:05 PM, Christine <christine.kar...@gmail.com>wrote: > > > > > > > I have two apps that use a service to upload and download files and > > data. I've noticed that when the service gets very busy, it can cause > > the UI to block, up to the point that Android shows a "force quit/ > > wait" popup. In order to avoid that, I run tasks in a service at a > > lower priority. This way, the service will never cause the UI to > > hickup. Also, the service stops if the app hasn't been used for a > > certain number of minutes. I don't want to keep resources if the user > > isn't using my app. > > > I have found that some of my users run apps that run services > > permanently at normal priority. Such a service starts at phone switch > > on, and keeps running indefinitely, downloading vast amounts of data. > > My policy of being nice to other apps doesn't pay off: these agressive > > third party services push my service away so it never gets anything > > done. As one of my users told me, my app has hickups, until he kills > > the service of this app X, after which my app runs smoothly, snappy, > > and fast. > > > My question is, should I be nice to other apps and to the UI in my own > > app, or should I just run a service and agressively take all resources > > I need - or don't need? This is one issue where Android is different > > from iPhone. We can run services, but by doing so, we can cause damage > > to other peoples apps. Of course, my "question" doesn't require an > > answer. I'm just curious after what other people think, what your > > experience here is. > > > -- > > 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%2Bunsubs > > cr...@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 For more options, visit this group at http://groups.google.com/group/android-developers?hl=en