Code example for NsdManager

Methods: resolveService

0
                    // The name of the service tells the user what they'd be 
                    // connecting to. It could be "Bob's Chat App". 
                    Log.d(TAG, "Same machine: " + mServiceName);
                } else if (service.getServiceName().contains(SERVICE_NAME)) {
 
                    mNsdManager.resolveService(service, mResolveListener);
                } 
            } 
 
            public void onServiceLost(NsdServiceInfo service) {
                // When the network service is no longer available. 
                // Internal bookkeeping code goes here. 
                Log.e(TAG, "service lost" + service);
            } 
 
            public void onDiscoveryStopped(String serviceType) {
                Log.i(TAG, "Discovery stopped: " + serviceType);
            } 
 
            public void onStartDiscoveryFailed(String serviceType, int errorCode) {
                Log.e(TAG, "Discovery failed: Error code:" + errorCode);