Hi Sagar,
Use AsycTask class if u want to publish the result or
response in the UI thread.
i.e. from the activity u called http connection .
If you want to listen for any updates say stock value,then use a
service which is like a background thread
always running .almost:)
On Jul 6, 3: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.
--
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