package com.example.josh.x_control; import java.io.IOException; import java.io.OutputStreamWriter; import java.net.InetAddress; import java.net.Socket; public class Singleton { private static Singleton INSTANCE = new Singleton(); private static InetAddress IP; public static Socket mySocket; public static OutputStreamWriter output; static { try { IP = InetAddress.getByName("192.168.0.14"); mySocket = new Socket(IP, 23456); output = new OutputStreamWriter(mySocket.getOutputStream()); } catch (IOException e) { e.printStackTrace(); } } private Singleton() {} public static synchronized Singleton getInstance() { return(INSTANCE); } }