How to Declare a Socket

Socket was added in API Level 1
Provides a client-side TCP socket.

1. In the MainActivity.java file, add the below import to the imports section.

import java.net.Socket;

2. In the onCreate method, add the below line to declare a new Socket named mySocket.

Socket mySocket;