This is ‘Ketai library source code’.
static public String getIP() {
String thing = “0.0.0.0”;try { for (Enumeration<NetworkInterface> en = NetworkInterface .getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); for (Enumeration<InetAddress> enumIpAddr = intf .getInetAddresses(); enumIpAddr.hasMoreElements();) { InetAddress inetAddress = enumIpAddr.nextElement(); if (!inetAddress.isLoopbackAddress() && thing == "0.0.0.0" && inetAddress.getHostAddress().matches( "\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b")) { thing = inetAddress.getHostAddress(); } PApplet.println("IP address: " + inetAddress.getHostAddress()); PApplet.println("thing : " + thing); } } } catch (SocketException ex) { PApplet.println("SocketException:" + ex.toString()); } catch (NullPointerException nx) { PApplet.println("Failed to get any network interfaces..."); } //PApplet.println("IP address: " + inetAddress.getHostAddress()); //PApplet.println("thing : " + thing); return thing;
}
The source code has been modified as shown below.
// && thing == “0.0.0.0”
I do not know the exact reason. ;;
The obvious thing is that there is an error in the Android 9.0 version of the smartphone.