Code example for WifiP2pManager

Methods: connect

	public void connectToPeer(WifiP2pDevice peer) {
		WifiP2pConfig config = new WifiP2pConfig();
		config.deviceAddress = peer.deviceAddress;
		config.wps.setup = WpsInfo.PBC;
		mManager.connect(mChannel, config, new ActionListener() {
			public void onSuccess() { 
				// Let WifiBroadcastReceiver notify us. Ignore it here. 
			public void onFailure(int reason) {
				// TODO: notify someone. 
	 * Initiate peer discovery to start the discovery process. Discovery will 
Connect your IDE to all the code out there  Get Codota for Java