android - bit confused on when to use threads & when to use services?
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 han开发者_如何学Pythongs on while(true){ socket.accept()}
You can read about threads and Android on the official documentation. Also, take a look at AsyncTask, that should help you a great lot.
精彩评论