Reputation: 494
I am writing an android application to make server socket and receive messages from server
when I write the same application using Thread, it works pretty well but I am unable to access UI elements in Thread
whereas in case of services, startService method hangs on while(true){ socket.accept()}
Upvotes: 1
Views: 220
Reputation: 11669
You can read about threads and Android on the official documentation. Also, take a look at AsyncTask, that should help you a great lot.
Upvotes: 1