Code example for NsdManager

Methods: resolveService

0
                if (!service.getServiceType().equals(SERVICE_TYPE)) {
                    Log.d(TAG, "Unknown Service Type: " + service.getServiceType());
                } else if (service.getHost() == null) {
                    Log.d(TAG, "Same machine: " + serviceName);
                } else if (service.getServiceName().contains(serviceName)){
                	nsdManager.resolveService(service, resolveListener);
                } 
            } 
 
            @Override 
            public void onServiceLost(NsdServiceInfo service) {
                Log.e(TAG, "service lost" + service);
                if (service.getHost() == null) {
                	mService = null;
                } 
            } 
             
            @Override 
            public void onDiscoveryStopped(String serviceType) {
                Log.i(TAG, "Discovery stopped: " + serviceType);
                discoveryStarted = false;