Re: [android-developers] Re: Socket sharing between activities

2012-04-19 Thread Federico Paolinelli
Can't say what's happening, but: if you took inspiration from there, you are creating the service as auto_create, which means that it stays around unless there are no bound activities anymore. Assuming that you are unbinding it on the onDestroy, the thread contained in the service may be still

Re: [android-developers] Re: Socket sharing between activities

2012-04-18 Thread Federico Paolinelli
Thanks again for the clarifications. Federico On Wed, Apr 18, 2012 at 1:26 AM, Dianne Hackborn hack...@android.com wrote: On Tue, Apr 17, 2012 at 12:03 AM, Federico Paolinelli fedep...@gmail.com wrote: Not using a service will make the connection available to be killed if the

Re: [android-developers] Re: Socket sharing between activities

2012-04-17 Thread Federico Paolinelli
Thanks Dianne for the clarification. I always thought that every task should have been performed in a native android component, was it an activity or a service. I am quite curious about this topic. Now, let's assume that his application does not need to fetch the data while in background, and

Re: [android-developers] Re: Socket sharing between activities

2012-04-17 Thread Dianne Hackborn
On Tue, Apr 17, 2012 at 12:03 AM, Federico Paolinelli fedep...@gmail.comwrote: Not using a service will make the connection available to be killed if the application goes background. Is that correct? Yes. And, if we want to close the connection when the application is no longer visible,

Re: [android-developers] Re: Socket sharing between activities

2012-04-16 Thread Dianne Hackborn
You don't need a service. And please please don't use startService() unless you really want to use up the user's resources with your app trying to run when they are not in it. Way too many apps I see abuse resources and keep themselves running in the background and thus just sucks. Just make a