Code example for NsdManager

Methods: discoverServices

0
 
	@Override 
	protected void onResume() { 
		super.onResume(); 
		dialog.show();
		nsdManager.discoverServices(SERVICE_TYPE, NsdManager.PROTOCOL_DNS_SD, this);
	} 
 
	@Override 
	protected void onPause() { 
		super.onPause(); 
		nsdManager.stopServiceDiscovery(this);
		adapter.clear();
		serviceMap.clear();
		dialog.hide();
	} 
 
	@Override 
	public void onDiscoveryStarted(String serviceType) {
		// TODO 
		Log.d("NSD", "onDiscoveryStarted: " + serviceType);