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, (PeerListListener) this);
            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 
Stop searching for code, let great code find you!  Add Codota to your java IDE