Code example for NsdServiceInfo

Methods: getHost, getPort, getServiceName, getServiceType

0
			System.out.print(arg0.getServiceName() + " cannot be resolved");
		} 
 
		@Override 
		public void onServiceResolved(NsdServiceInfo _nsdServiceInfo) {
        	if(!foundDevices.containsKey(_nsdServiceInfo.getServiceName())) {
        		foundDevices.put(_nsdServiceInfo.getServiceName(), new NetworkDevice(_nsdServiceInfo.getHost(),_nsdServiceInfo.getPort(),_nsdServiceInfo.getServiceName(),_nsdServiceInfo.getServiceType()));
        		if (coapSocket == null) openSocket();
        		startSensorListener(); 
        		statusMessages.add("Service resolved \n");
        		 
        	} 
		} 
	} 
	 
	private class ServiceListener implements DiscoveryListener {
 
		 
		//http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xml