开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜