Example usage for android.net.nsd NsdManager PROTOCOL_DNS_SD

List of usage examples for android.net.nsd NsdManager PROTOCOL_DNS_SD

Introduction

In this page you can find the example usage for android.net.nsd NsdManager PROTOCOL_DNS_SD.

Prototype

int PROTOCOL_DNS_SD

To view the source code for android.net.nsd NsdManager PROTOCOL_DNS_SD.

Click Source Link

Document

Dns based service discovery protocol

Usage

From source file:ibp.plugin.nsd.NSDHelper.java

public void startDiscovery() {
    mNsdManager.discoverServices(SERVICE_TYPE, NsdManager.PROTOCOL_DNS_SD, mDiscoveryListener);
}

From source file:ibp.plugin.nsd.NSDHelper.java

public void registerService(String name, int port) {
    NsdServiceInfo serviceInfo = new NsdServiceInfo();
    serviceInfo.setPort(port);// ww w  . j ava2s . c o  m
    serviceInfo.setServiceName(name);
    serviceInfo.setServiceType(SERVICE_TYPE);
    mNsdManager.registerService(serviceInfo, NsdManager.PROTOCOL_DNS_SD, mRegistrationListener);
}

From source file:org.drulabs.localdash.nsddiscovery.NsdHelper.java

public void registerService(int port) {
    tearDown(); // Cancel any previous registration request
    initializeRegistrationListener();/*  ww  w  . ja v a2s  .  c om*/
    NsdServiceInfo serviceInfo = new NsdServiceInfo();
    serviceInfo.setPort(port);
    serviceInfo.setServiceName(mServiceName);
    serviceInfo.setServiceType(SERVICE_TYPE);
    Log.v(TAG, Build.MANUFACTURER + " registering service: " + port);
    mNsdManager.registerService(serviceInfo, NsdManager.PROTOCOL_DNS_SD, mRegistrationListener);
}

From source file:org.drulabs.localdash.nsddiscovery.NsdHelper.java

public void discoverServices() {
    stopDiscovery(); // Cancel any existing discovery request
    initializeDiscoveryListener();/*from   w  ww. j  av a2  s. c  o  m*/
    mNsdManager.discoverServices(SERVICE_TYPE, NsdManager.PROTOCOL_DNS_SD, mDiscoveryListener);
}