When I use normal Java socket programming in Android, the app crashes.
Socket sock=new Socket(Ip,Port);
DataInputStream din=new DataInputStream(sock.getInputStream());
When I use normal Java socket programming in Android, the app crashes.
Socket sock=new Socket(Ip,Port);
DataInputStream din=new DataInputStream(sock.getInputStream());
I think you cannot run network operations in UI Thread, so start another Thread, or use AsyncTask, or anything else. Another reason could be permissions, add these lines in your manifest <uses-permission android:name="android.permission.INTERNET"/>