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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: getDeviceList
        if (progressDialog != null && progressDialog.isShowing()) {
            progressDialog.dismiss();
        } 
        if (getListAdapter() != null) {
        	peers.clear();
        	peers.addAll(peerList.getDeviceList());
        	((WiFiPeerListAdapter) getListAdapter()).notifyDataSetChanged();
        } 
        if (peers.size() == 0) {
            Log.d("Test", "No devices found");
            return; 
        } 
 
    } 
 
    public void clearPeers() { 
        peers.clear();
        ((WiFiPeerListAdapter) getListAdapter()).notifyDataSetChanged();
    } 
 
Full Snippet Info
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: getDeviceList
    public void onPeersAvailable(WifiP2pDeviceList peerList) {
        if (progressDialog != null && progressDialog.isShowing()) {
            progressDialog.dismiss();
        } 
        peers.clear();
        peers.addAll(peerList.getDeviceList());        
        ((WiFiPeerListAdapter) getListAdapter()).notifyDataSetChanged();
        if (peers.size() == 0) {
             
            return; 
        } 
 
    } 
 
    public void clearPeers() { 
        peers.clear();
        ((WiFiPeerListAdapter) getListAdapter()).notifyDataSetChanged();
    } 
 
    /** 
Full Snippet Info
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: getDeviceList
 
   @Override 
   public void onPeersAvailable(WifiP2pDeviceList peers)
   { 
      // TODO Auto-generated method stub 
      for (WifiP2pDevice device : peers.getDeviceList())
      { 
         this.device = device;
         break; 
      } 
   } 
 
   @Override 
   public void onClick(View v)
   { 
 
      if (v == buttonConnect)
      { 
         connect(this.device);
      } 
Full Snippet Info
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: getDeviceList
     * (android.net.wifi.p2p.WifiP2pDeviceList) 
     */ 
    @Override 
    public void onPeersAvailable(WifiP2pDeviceList peers) {
        mList.clear();
        mList.addAll(peers.getDeviceList());
 
        if (mAdapter == null) {
            mAdapter = new Adapter();
            setListAdapter(mAdapter);
        } else { 
            mAdapter.notifyDataSetChanged();
        } 
    } 
 
    private class Adapter extends BaseAdapter {
 
        @Override 
        public int getCount() { 
            return mList.size();
Full Snippet Info
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Android WifiP2pDeviceList Questions & Answers:

See Code Examples for Android WifiP2pDeviceList Methods: