Android listen for messages from server socket

后端 未结 1 1775
小鲜肉
小鲜肉 2021-02-06 03:10

I am trying to create an android app that communicates with a local server through a socket. The communication passes simple commands and data in strings using JSON. The client

1条回答
  •  滥情空心
    2021-02-06 03:18

    You can create in your Service one thread for listening to the server. The second thread is for sending commands. Then for your service you should create a main thread with handler in it. This handler will process messages from this two threads.

    0 讨论(0)
提交回复
热议问题