Code example for NsdServiceInfo

Methods: getHostgetPortgetServiceName

0
	        @Override 
	        public void onServiceResolved(NsdServiceInfo serviceInfo) 
	        { 
	            Log.e(TAG, "Resolve Succeeded. " + serviceInfo);
 
	            if (serviceInfo.getServiceName().equals(mServiceName)) 
	            { 
	                Log.d(TAG, "Same IP.");
	                return; 
	            } 
	            mService = serviceInfo;
	            int port = mService.getPort();
	            Log.d(TAG, "Port="+port);
	            InetAddress host = mService.getHost();
	            Log.d(TAG, "Adresse"+host.getHostAddress());
	        } 
	    }; 
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java