Code example for WifiP2pManager

Methods: requestConnectionInfo

0
			NetworkInfo netInfo = intent.getParcelableExtra(WifiP2pManager.EXTRA_NETWORK_INFO);
			Log.i(TAG, "Wifi p2p connection changed " + netInfo);
			isConnected = netInfo.isConnected();
			Log.i(TAG, "Wifip2p connection is connected ? " + isConnected);
			if (isConnected) {
			wifiMgr.requestConnectionInfo(channel, new ConnectionInfoListener() {
				 
				@Override 
				public void onConnectionInfoAvailable(WifiP2pInfo info) {
						Log.i(TAG, "Wifi p2p connection is formed ? " + info.groupFormed);
						wifiMgr.requestGroupInfo(channel, new GroupInfoListener() {
							 
							@Override 
							public void onGroupInfoAvailable(WifiP2pGroup group) {
								if (group == null)
									return; 
								WifiP2PHelper.this.group = group;
								Log.i(TAG, "Wifi p2p connection group is  " + group.getNetworkName());
								Log.i(TAG, "Group size " + group.getClientList().size());
								fireOnConnectionSucceed(group.getNetworkName(), group.getPassphrase());