private String get_available_IP() {
    	// Find available IPs. 
		String str="";
		InetAddress ip;
		String host="not connected";
		
		try {
 
			ip = InetAddress.getLocalHost();
			host = ip.getHostAddress();
			System.out.println("Current IP address : " + host);
 
		} catch (UnknownHostException e) {
			e.printStackTrace(); 
		}
		
    	try {
			Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
			while (e.hasMoreElements()) {
				NetworkInterface ni = e.nextElement();				
				Enumeration<InetAddress> ips = ni.getInetAddresses();
				while (ips.hasMoreElements()) {
					String ipa =  ips.nextElement().toString();
					
					if (ipa.startsWith("/"))
						ipa = ipa.substring(1);
					
					if (ipa.indexOf(':') >= 0) {  // IPv6. Ignore
						continue;
					}
					
					if (ipa.equals("127.0.0.1")) {
						continue;		// loopback IP. Not meaningful for out purpose
					}
					
					if (ipa.equals(host)) {
					   str += ipa + " (connected) \n";
					}
					else str += ipa + "\n";
				}
			}
		
    	} catch (SocketException e) {
			
			e.printStackTrace();
		}
    	if (str.isEmpty())
    		str="network is not available.\n";
    	return str;
    }