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
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.