Code example for NsdManager

Methods: registerService

0
		serviceInfo.setServiceType(sServiceType);
 
		Log.d(TAG, "registerService service=" + serviceInfo);
 
		mRegistrationListener = generateRegistrationListener();
		mNsdManager.registerService(serviceInfo, NsdManager.PROTOCOL_DNS_SD,
				mRegistrationListener);
	} 
 
	RegistrationListener generateRegistrationListener() {
		return new NsdManager.RegistrationListener() {
 
			@Override 
			public void onServiceRegistered(NsdServiceInfo service) {
				Log.d(TAG, "RegistrationListener#onServiceRegistered service="
						+ service);
			} 
 
			@Override 
			public void onRegistrationFailed(NsdServiceInfo service,
					int errorCode) {