Budhdi Sharma
Aug 14, 2023

--

No, you cannot use LocalSocket to establish a TCP connection by providing a socket address like 192.168.0.12. LocalSocket is a class in the Android SDK that is used to create and manage Unix domain sockets.

If you want to establish a TCP connection to a remote machine, you will need to use the java.net.Socket class. The Socket class provides methods for creating and managing TCP sockets. You can use the Socket class to connect to a remote machine by specifying the machine's IP address and port number.

Socket socket = new Socket("192.168.0.12", 8080);

socket.connect();

--

--

Budhdi Sharma
Budhdi Sharma

Written by Budhdi Sharma

As an AI Enthusiast & AOSP/AAOS/XROS/RTOS Engineer, I specialize in creating robust frameworks, and systems that seamlessly integrate with embedded systems.

No responses yet