Code example for WifiManager

Methods: createMulticastLock

    	servers = new ArrayList<Map<String,String>>();
    	//By default, the android wifi stack will ignore broadcasts, fix that 
    	WifiManager wm = (WifiManager)getSystemService(Context.WIFI_SERVICE);
    	multicastLock = wm.createMulticastLock("mpdroid_bonjour");
    	try { 
			jmdns = JmDNS.create();
			jmdns.addServiceListener("_mpd._tcp.local.", this);
		} catch (IOException e) {
			//Do nothing, stuff will just not work 
		listAdapter = new SimpleAdapter(this, servers, android.R.layout.simple_list_item_1, new String[]{SERVER_NAME}, new int[]{});
    protected void onPause() { 
Connect your IDE to all the code out there  Get Codota for Java