private String getIPAddress() {

		String ip = null;
		try {
			Enumeration<NetworkInterface> interfaces = NetworkInterface
					.getNetworkInterfaces();
			while (interfaces.hasMoreElements()) {
				NetworkInterface iface = interfaces.nextElement();

				if (iface.isLoopback() || !iface.isUp()
						|| !iface.isPointToPoint()) {
					continue;
				}

				Enumeration<InetAddress> addresses = iface.getInetAddresses();
				while (addresses.hasMoreElements()) {
					ip = addresses.nextElement().getHostAddress();
					if (ip.matches("[0-9.]+")) {
						return ip;
					}

				}
			}
		} catch (SocketException e) {
			throw new RuntimeException(e);
		}

		return ip;
	}