It solely depends upon your implementation whether a service starts, shuts down or restarts; regardless whether you do this from your application or an activity. In other words you shouldn't shut down the service once the activity finishes. This will keep it running and next time your activity starts it will simply connect to the already running service again. That's exactly what I'm doing in my current project.
I suggest you check out the Remote Service Tutorial over at anddev.org - It should give you a quite good start: http://www.anddev.org/remote_service_tutorial-t8127.html -- André http://android.rabold.org On 16 Okt., 06:38, pink 444 <[email protected]> wrote: > Hai, > > My application has a background process which continuously waits > on a socket for receiving messages and it should be started only once > and at the time of application starting.Thus i want to do that > background job in a service. > > The service should not be started from the activity ,it should be > started at the application starting. > > How can i define the service,which will be started at the time of > application starting? > > If at all the service is started from activity.The activity can be > destroyed > and restarted.when this happens the service also be restarted . > > Any help will be appreciated highly. > > Thanks, > -SIva. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

