If you're running on a G1, and have even low-mid memory reqs, you are pretty much SOL. Android will kill off processes to free resources for new foreground activities, and services, particularly those running in a background process, will get axed first. Watch logcat in verbose mode to validate that this is indeed what is happening.
Things are going to get even worse for you in 1.6. Donut itself consumes more memory leaving less room for your background service. Once a foreground activity is bound to your service, the service will be much less likely to get killed, so your only option in low-mem scenarios may be to check at binding time and see if your persistent connection is available, and reconnect if not. This approach is the best solution that I can think of for gracefully "degrading" the functionality of your service in low-mem situations. On Nov 20, 3:52 am, Ash <[email protected]> wrote: > Hi!!, > > I am running a background Android Service as VoIP Framework which > provides different VoIP services to different Android applications, > (VoIP call, Video Call, etc). The service establishes a network > connection with the Server(Service Provider) and does some initial > handshake before it can start providing service to the Android > applications, that’s why though of starting the service on > BOOT_COMPLETED event. > > The problem is when the service gets started on BOOT_COMPLETED event, > before even it finishes the initial network connection with server and > handshaking, it gets killed by the system. > > I have tried using setForeground which improves the behavior a bit but > still gets killed mid-way. I am working with old version 1.5 r3 of SDK > and hence, cannot use "startForeground". > > Is there a way out or another alternative available with SDK 1.5 r3? > > Thanks in advance, > Ash -- 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

