Code example for WifiP2pManager

Methods: requestPeers

            // request available peers from the wifi p2p manager. This is an 
            // asynchronous call and the calling activity is notified with a 
            // callback on PeerListListener.onPeersAvailable() 
            if (manager != null) {
                manager.requestPeers(channel, mNetInfManager);
            Log.d(TAG, "P2P peers changed");
        } else if (WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION.equals(action)) {
            if (manager == null) {
            NetworkInfo networkInfo = (NetworkInfo) intent
            if (networkInfo.isConnected()) {
                // we are connected with the other device, request connection