Host is null in NsdServiceInfo of NsdManager.DiscoveryListener.onServiceFound
I'm trying to get the mHost of the NsdServiceInfo passed as parameter to NsdManager.DiscoveryListener.onServiceFound() but it's null. I have two android devices where device 1 is the server and device 2 is the client. This is how I register the server in the device 1 public void registerService(int port, InetAddress myIp) { NsdServiceInfo serviceInfo = new NsdServiceInfo(); serviceInfo.setPort(port); serviceInfo.setServiceName(this.serviceName); serviceInfo.setServiceType(SERVICE_TYPE); serviceInfo.setHost(myIp); this.nsdManager.registerService( serviceInfo, NsdManager.PROTOCOL_DNS_SD,