Code example for NsdManager

Methods: resolveService

	public static void initializeDiscoveryListener() { 
		mDiscoveryListener = new NsdManager.DiscoveryListener() {
			public void onDiscoveryStarted(String regType) {
				Log.d(TAG, "Service discovery started");
			public void onServiceFound(NsdServiceInfo service) {
				Log.d(TAG, "Service discovery success");
				Log.d(TAG, String.format("%s %s %s %d",
						service.getServiceName(), service.getServiceType(),
						service.getHost(), service.getPort()));
				if (!service.getServiceType().contains(SERVICE_TYPE)) {
							"Unknown Service Type: " + service.getServiceType());
				} else if (service.getServiceName().equals(mServiceName)) {
Connect your IDE to all the code out there  Get Codota for Java