the getHostName function in ZeroConf.java is misbehaving under Anrdoid 8 (Samsung Galaxy S8) and Android 10 (Samsung S10 and Emulated Pixel 3a)
The Function getString.invoke(null, "net.hostname").toString(); is not returning an empty string but the string "unknown".
So I had to add this possibility to the following if clause:
if (TextUtils.isEmpty(hostName)) {
It now looks like this in my project:
if (TextUtils.isEmpty(hostName) || hostName == "unknown") {
the getHostName function in ZeroConf.java is misbehaving under Anrdoid 8 (Samsung Galaxy S8) and Android 10 (Samsung S10 and Emulated Pixel 3a)
The Function getString.invoke(null, "net.hostname").toString(); is not returning an empty string but the string "unknown".
So I had to add this possibility to the following if clause:
if (TextUtils.isEmpty(hostName)) {
It now looks like this in my project:if (TextUtils.isEmpty(hostName) || hostName == "unknown") {