I'm developing an Android application that opens a TCP port in the mobile to handle requests.
I have created a button which when pressed runs a thread which creates a server socket like this:
serverSocket = new ServerSocket(port);
Socket socket = serverSocket.accept();
But as accep() waits for a connexion and it stops the whole user interface, you can't do anything with it.
The server works ok, but the interface doesn't work.
Does anybody know how to make the main process not wait for the thread?
Thanks in advance