I have two questions,
First, I am running an Android emulator that connects to Python server to download images from it. For some reason,the socket is not connecting to remote server. I am using IP address of the server and port which the server is listening to. If someone can help me, that will be great.
EDIT: I also exported the apk file and installed the app in my phone. It still does not work.
My code:
ip = InetAddress.getLocalHost();
InetAddress serverAddr = InetAddress.getByName("56.249.79.139");
int port2ConnectDefault = 8002;
Socket socket;
BufferedReader in;
PrintWriter out;
//System.out.print(ip.getHostAddress());
Log.v("Check_insert", "got in");
socket = new Socket(serverAddr, port2ConnectDefault);
Log.v("Check_insert", "got in2");
System.out.println("Connected to server...sending echo string");
I get "Check_insert", "got in" log but not "Check_insert", "got in2.
Second, Is there any way other then using sockets to have Android client download image from python server using IP address and port number ? I looked at okhttp but I could not figure out how this would work out in the python side.
Thanks a bunch!