WifiP2pManager discoverServices - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for WifiP2pManager discoverServices method.

This code example shows how to use the following methods:discoverServices, setDnsSdResponseListeners
	} 
	 
	private void startDiscovery() { 
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
			registerServiceRequest(); 
			wifiMgr.setDnsSdResponseListeners(channel, discoveryListener, null);
			wifiMgr.discoverServices(channel, new TaggedActionListener("discoverService"));
		} else { 
			wifiMgr.discoverPeers(channel, new TaggedActionListener("discoverPeers"));
		} 
	} 
	 
	private void stopDiscovery() { 
		Log.i(TAG, "stop wifi p2p discovery");
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
			wifiMgr.stopPeerDiscovery(channel, new TaggedActionListener("stopPeerDiscovery"));
		} 
	} 
	 
	public void registerService(String serviceName, String serviceType) {
3
CodeRank
discoverServices Method Overview
Initiate service discovery.
See Code Examples for other Android WifiP2pManager Methods: