SOLVED: Problems with TCP server and its interface

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

SOLVED: Problems with TCP server and its interface

Postby puxdroid » Thu Nov 26, 2009 1:21 pm

Hello!

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
Last edited by puxdroid on Mon Nov 30, 2009 11:35 am, edited 1 time in total.
puxdroid
Developer
Developer
 
Posts: 49
Joined: Wed Nov 25, 2009 11:57 am

Top

Postby virtual » Thu Nov 26, 2009 2:03 pm

Start your server socket in a separate Thread.
Regards,
Virtual
virtual
Developer
Developer
 
Posts: 26
Joined: Tue Mar 24, 2009 11:20 am

Postby puxdroid » Thu Nov 26, 2009 2:41 pm

Solved!

see this topic
puxdroid
Developer
Developer
 
Posts: 49
Joined: Wed Nov 25, 2009 11:57 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests