[android-developers] Which is better in Performance ?

2010-08-24 Thread tarek attia
Hi all,, I have a service which collect data and send them to a certain URL and updating the main activity GUI ,so which is better in the performance to use a long service with listeners to collect the data and threads in it to update the GUI and sends to the internet Or to make another service

Re: [android-developers] Which is better in Performance ?

2010-08-24 Thread TreKing
On Tue, Aug 24, 2010 at 2:34 PM, tarek attia tarek.m.at...@gmail.comwrote: so which is better This will be highly dependent on your implementation of either option, neither of which I think you've explained clearly enough for anyone to really make an educated guess on.

Re: [android-developers] Which is better in Performance ?

2010-08-24 Thread Kostya Vasilyev
You can't update UI from a service, and can't perform sustained tasks from an Activity. So, by way of excluding the impossible, you should end up with a sort of canonical design. An Activity for the UI, a service with a worker thread to perform lengthy network-related tasks, working together to

Re: [android-developers] Which is better in Performance ?

2010-08-24 Thread tarek attia
2010/8/24 Kostya Vasilyev kmans...@gmail.com You can't update UI from a service, and can't perform sustained tasks from an Activity. I didn't say directly I will update the GUI from a service but by using broadcast receivers I can do what I want So, by way of excluding the impossible, you

Re: [android-developers] Which is better in Performance ?

2010-08-24 Thread Kostya Vasilyev
You will definitely need at least one thread in the service for networking. A separate service for data collection might be easier to implement and debug, but having one service do both would avoid excessive data shuffling, as it would be available within the same service. Both ways can work,