Thanks for the valuable pointers. Basically, the services i described are going to be built upon a protocol stack, namely SIP. All services i mentioned will be registered as listeners to the stack. For the call control etc to work, my SIP stack needs to be alive and kicking to receive messages from the network and send messages to the network on user input. If my stack dies, the rest of the application will have no meaning. I completely agree with the on-demand service creation that performs a set of logically related activities and closes down. This is perfect for call control, registration etc. However, my sip stack needs to be kept alive for as long as my application is alive. Should i still mould the sip stack as a service then? Or are there better ways to do it ?
Thanks for all the help. really appreciated aayush On 6/4/09, Mark Murphy <mmur...@commonsware.com> wrote: > >> Just a note on Services that is probably important to you. If they do >> not belong to the current foreground process, they are given quite a >> low priority rating by the OS, so they will be terminated quite soon >> if resources get low. > > Uh, are you sure about that? > > "If the service has been started, then its hosting process is considered > to be less important than any processes that are currently visible to the > user on-screen, but more important than any process not visible. Because > only a few processes are generally visible to the user, this means that > the service should not be killed except in extreme low memory conditions. > " > > (from http://developer.android.com/reference/android/app/Service.html) > > Activities that are on the stack, from applications other than the > foreground, should be cleared out before any service. > >> Generally for Services that only exist for a >> small task this will rarely come in to effect but for your long >> running Services, you are likely going to be effected by this over a >> period of time. > > That's certainly true. There is no such thing as an indefinitely-running > Service -- only a temporarily-lucky Service. Having a local Service that > supports a set of activities and then closes down is great. Having a > Service that is triggered by AlarmManager to do some work and then closes > down is great. Having a Service that thinks it will live forever is > unrealistic. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com > _The Busy Coder's Guide to Android Development_ Version 2.0 Available! > > > > > > -- aayush ---------------------------------------------------- "Cleverly disguised as a responsible adult" --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---