Code example for NsdManager

Methods: discoverServices

0
    } 
 
    public void clickDiscovery(View v) {
        initializeResolveListener(); 
        initializeDiscoveryListener(); 
        mNsdManager.discoverServices(SERVICE_TYPE, NsdManager.PROTOCOL_DNS_SD, mDiscoveryListener);
    } 
    public void initializeDiscoveryListener() { 
        mDiscoveryListener = new NsdManager.DiscoveryListener() {
 
            @Override 
            public void onStartDiscoveryFailed(String serviceType, int errorCode) {
                logMsg("Discovery failed: Error Code: " + errorCode);
            } 
 
            @Override 
            public void onStopDiscoveryFailed(String serviceType, int errorCode) {
                logMsg("discovery failed: Error Code: " + errorCode);
            } 
 
            @Override