Code example for NsdServiceInfo

Methods: setPortsetServiceNamesetServiceType

0
     * Allocate ServiceInfo object for register service. 
     *  
     * @return 
     */ 
    static NsdServiceInfo allocateServiceInfo() {
        NsdServiceInfo serviceInfo = new NsdServiceInfo();
        serviceInfo.setPort(SERVICE_PORT);
        serviceInfo.setServiceName(SERVICE_NAME);
        serviceInfo.setServiceType(SERVICE_TYPE);
        return serviceInfo;
    } 
 
    /** The instance of NsdManager */ 
    NsdManager nsdManager;
 
    /** 
     * Ensure SystemService objects. 
     */ 
    void ensureSystemServices() { 
        nsdManager = (NsdManager) getSystemService(NSD_SERVICE);
Connect your IDE to all the code out there  Get Codota for Java