When I use my code in HTC Wildfire S (API10, android 2.3.3), this works fine. But if I run on Samsung Galaxy S4 (API19, android 4.4.2), it doesn't work (application starts and closes; nothing happens). The server is on my local computer (Hercules Program). Of course I added the permission (INTERNET) in manifest.
The code is:
try{
Socket s = new Socket("192.168.1.13", 6914);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
String outMsg = "";
outMsg = "This is Client";
out.write(outMsg);
out.flush();
out.close();
s.close();
} catch (IOException e) {
e.printStackTrace();
}
So could you help me and show where the problem is? I didn't root my Samsung phone.