public static String getIP() {
		Logger.log("Getting network interfaces");
		Enumeration<NetworkInterface> e;
		try {
			e = NetworkInterface.getNetworkInterfaces();
			Logger.log(e.toString());
			while (e.hasMoreElements()) {
				NetworkInterface n = (NetworkInterface) e.nextElement();
				Logger.log(n.getDisplayName());
				if (n.isLoopback() || !n.isUp() || !n.supportsMulticast()) {
					Logger.log("Invalid interface");
					continue;
				}
				Enumeration<InetAddress> ee = n.getInetAddresses();
				while (ee.hasMoreElements()) {
					InetAddress i = (InetAddress) ee.nextElement();
					Logger.log(i.toString());
					if (!i.getHostAddress().startsWith("127.")
							&& !i.getHostAddress().startsWith("fe80"))
						return i.getHostAddress();
				}
			}
			Logger.log("Problems with internet connection.");
		} catch (SocketException e1) {
			Logger.log("Problems with internet connection.");
		}
		try {
			Logger.log("No Internet connection...");
			Logger.log("Getting local address");
			return InetAddress.getLocalHost().getHostName();
		} catch (UnknownHostException e1) {
			Logger.log("Im sorry for your computer.");
			return null;
		}
	}