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
Total guess this one, but have you tried calling flush()
on the output stream before closing?
Try putting an out.flush();out.close();
after the println(..)
;
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
:
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
after <uses-sdk>
and before <application>