On Jul 6, 12:12 pm, sagare <[email protected]> wrote: > Hi All, > > Thanks for your replies AsynTask seems to be what I should use but I > am still not clear with the difference between service and Thread for > Http communication. > > Thanks, > Sagar > > On Jul 6, 12:43 am, Frank Weiss <[email protected]> wrote: > > > Only people who want to punish themselves use Java threads on Android:-) > > > But you also asked about Service. You can use an AsyncTask in an > > Activity if the task has to happen while the activity is active. If > > the task needs to happen also when the acitivity is not active, (like > > when the user goes to other activities while the task is downloading > > stuff) use an AsyncTask in a Service.
Services run in the application's main thread. Check this excellent post on multitasking on android http://android-developers.blogspot.com/2010/04/multitasking-android-way.html and this other thread http://groups.google.it/group/android-developers/browse_thread/thread/d5b97af5032725e9?hl=it# Hope it helps Federico -- 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

