Android WifiP2pDeviceList - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android WifiP2pDeviceList class.

This code example shows how to use the following methods: getDeviceList
     * Visualizza una lista di peers nel fragment  
     * @param peerList WifiP2pDeviceList - Lista di peers da visualizzare 
     */ 
    public void setPeerList(WifiP2pDeviceList peerList){
    	peers.clear();
        peers.addAll(peerList.getDeviceList());
        ((WiFiPeerListAdapter) getListAdapter()).notifyDataSetChanged();
        if (peers.size() == 0) {
            return; 
        } 
    } 
     
    /** 
     * Svuota la lista di Peers 
     */ 
    public void clearPeers() { 
        peers.clear();
        ((WiFiPeerListAdapter) getListAdapter()).notifyDataSetChanged();
    } 
     
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDeviceList
    public void onReceive(Context context, Intent intent) { 
      wifiP2pManager.requestPeers(wifiDirectChannel,  
        new PeerListListener() { 
          public void onPeersAvailable(WifiP2pDeviceList peers) { 
            deviceList.clear(); 
            deviceList.addAll(peers.getDeviceList()); 
            aa.notifyDataSetChanged(); 
          } 
        }); 
    } 
  }; 
   
  /** 
   * Listing 16-23: Requesting a connection to a Wi-Fi Direct peer 
   */ 
  private void connectTo(WifiP2pDevice device) {
    WifiP2pConfig config = new WifiP2pConfig();
    config.deviceAddress = device.deviceAddress;
 
    wifiP2pManager.connect(wifiDirectChannel, config, actionListener);
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDeviceList
			this.devices = new ArrayList<WifiP2pDevice>();
		} 
 
		@Override 
		public void onPeersAvailable(WifiP2pDeviceList peers) {
			devices.addAll(peers.getDeviceList());
			searchingForLinks = false;
		} 
 
	} // end of WifiPeerListListener class 
 
	 
	/** 
	 * This class models a generic listener that 
	 * response to onSuccess() and onFailure(int) calls 
	 * @author Josh Noel 
	 */ 
	private class GenericActionListener implements ActionListener {
 
		private static final int TYPE_CONNECTION = 0;
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDeviceList
	 * 各Peerの状態が分かった時のコールバック. 
	 */ 
	@Override 
	public void onPeersAvailable(WifiP2pDeviceList peers) {
		List<WifiP2pDevice> deviceList = new ArrayList<WifiP2pDevice>(
				peers.getDeviceList());
		mCallback.onPeersAvailable(deviceList);
	} 
 
	/** 
	 * 接続しているWi-Fi Directについての情報をリクエストする. 
	 */ 
	public void requestConnectionInfo() { 
		mManager.requestConnectionInfo(mChannel, this);
	} 
 
	/** 
	 * 接続情報が通知されてきた時のコールバック. 
	 */ 
	@Override 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDeviceList
        if (progressDialog != null && progressDialog.isShowing()) {
            progressDialog.dismiss();
        } 
         
        peers.clear();
        peers.addAll(peerList.getDeviceList());
        ((WiFiPeerListAdapter) getListAdapter()).notifyDataSetChanged();
         
        if (peers.size() == 0) {
            Lg.d("No devices found"); 
            return; 
        } 
 
    } 
 
    public void clearPeers() { 
        peers.clear();
        ((WiFiPeerListAdapter) getListAdapter()).notifyDataSetChanged();
    } 
 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android WifiP2pDeviceList Questions & Answers:

See Code Examples for Android WifiP2pDeviceList Methods: