views:

47

answers:

1

Hy!

I have a service from which a start a new thread. This new thread will communicate with a TCP server using socket. What is the best way to send the data received from TCP server back to the service? Handlers or something else?

Thanks in advance, kukukk

A: 

What is the best way to send the data received from TCP server back to the service?

Make the thread be an inner class of the service, then just call a method on the service.

CommonsWare
This is the commonly used solution and officially advised by Android developers, or it is just easier?
kukukk