I decided to connect the server with the Android application. Entered the necessary port: 7777, ip: 127.0.0.1 and clicked to start, but the client server does not see.
Here is the application code:
public class MainActivity extends AppCompatActivity { int sPort = 7777; String ip = "127.0.0.1"; private TextView textView; private Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView = (TextView) findViewById(R.id.textView); button = (Button) findViewById(R.id.button); View.OnClickListener onClickListener = new View.OnClickListener() { @Override public void onClick(View v) { if(v.getId() == R.id.button) { new Thread(new Runnable() { @Override public void run() { try { textView.setText("Server off"); InetAddress inetAddress = InetAddress.getByName(ip); Socket socket = new Socket(ip, sPort); textView.setText("Connected"); InputStream sin = socket.getInputStream(); OutputStream sout = socket.getOutputStream(); DataInputStream in = new DataInputStream(sin); DataOutputStream out = new DataOutputStream(sout); } catch (Exception x) { x.printStackTrace(); } } }).start(); } } }; button.setOnClickListener(onClickListener); } }