Sending TCP data from Android (as client) - no data being sent?

前端 未结 3 1676
梦如初夏
梦如初夏 2020-12-24 15:28

I\'m trying to send data from my Android app to my PC over TCP.

The code is as follows:

Socket socket = new Socket(\"10.0.78.75\", 50505);   

Output         


        
3条回答
  •  死守一世寂寞
    2020-12-24 16:18

    I had the same problem and Haphazard's solutions wasn't good enough for me. I think that you should use (in this case) output.flush(); and output.close(); instead of out.flush(); and out.close();. And you have to remember about internet permission in AndroidManifest.xml:

    
    

    after and before

提交回复
热议问题