I would like to use sockets for a client-server communication between Python and Android. Currently I established a connection from Android to the Python server. This works well. I can also send messages to the server. Now I tried to send a response to Android.
The python code:
clientsocket.send(bytes("Testmessage","UTF-8"))
There is no error.
In the Android app, I tried to get the result via BufferedReader:
BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));
Log.e("Test",""+in.read()); // returns 84
Log.e("Test2",""+in.readLine()); // no console output
Any idea how I could fix it?
question from:
https://stackoverflow.com/questions/65651564/client-server-socket-communication-between-android-and-python 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…