I made a client / server socket application but it only works with the emulator

1

I made a client / server socket application, where the client is a device with android and the server is done in java. At the beginning this is all ok, in the emulator it runs correctly, but when I install the apk on the cell it does not work, it says the application stopped.

    
asked by anonymous 06.04.2014 / 23:11

2 answers

1

Check the Firewall is not blocking external access from your PC. Home When connecting, use AsyncTask because if the connection is delayed it will give timeout in the application

    
11.04.2014 / 18:57
0

Create a version of the apk that has the ip of the computer and not "localhost" in its same ip band. That way you will have to install the app on your Smartphone and you will have to connect to the same network as your computer where your server is located.

    
09.12.2015 / 19:14