public class BlaubotWifiP2PBroadcastReceiver
extends BroadcastReceiver
BlaubotWifiP2PBroadcastReceiver.IBlaubotWifiDirectEventListener
s
to this object via addEventListener(..).Modifier and Type | Class and Description |
---|---|
static interface |
BlaubotWifiP2PBroadcastReceiver.IBlaubotWifiDirectEventListener |
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
LOG_TAG |
Constructor and Description |
---|
BlaubotWifiP2PBroadcastReceiver(WifiP2pManager manager,
Channel channel)
The needed
WifiP2pManager and Channel can be retrieved like this:
mManager = (WifiP2pManager) context.getSystemService(Context.WIFI_P2P_SERVICE);
mChannel = mManager.initialize(context, context.getMainLooper(), null); |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(BlaubotWifiP2PBroadcastReceiver.IBlaubotWifiDirectEventListener listener)
Adds an event listener to this receiver.
|
static IntentFilter |
createWifiP2PIntentFilter()
Creates an
IntentFilter for the WIFIDirect intents needed by this BroadcastReceiver . |
protected void |
notify_list_of_peers_changed(WifiP2pDeviceList peers) |
void |
onReceive(Context context,
Intent intent) |
void |
removeEventListener(BlaubotWifiP2PBroadcastReceiver.IBlaubotWifiDirectEventListener listener)
Removes an event listener from this receiver, if registered.
|
protected static final java.lang.String LOG_TAG
public BlaubotWifiP2PBroadcastReceiver(WifiP2pManager manager, Channel channel)
WifiP2pManager
and Channel
can be retrieved like this:
mManager = (WifiP2pManager) context.getSystemService(Context.WIFI_P2P_SERVICE);
mChannel = mManager.initialize(context, context.getMainLooper(), null);manager
- the WifiP2pManager
manager instacechannel
- the channelpublic void onReceive(Context context, Intent intent)
public void addEventListener(BlaubotWifiP2PBroadcastReceiver.IBlaubotWifiDirectEventListener listener)
listener
- the listener to be attachedpublic void removeEventListener(BlaubotWifiP2PBroadcastReceiver.IBlaubotWifiDirectEventListener listener)
listener
- the listener to be attachedpublic static IntentFilter createWifiP2PIntentFilter()
IntentFilter
for the WIFIDirect intents needed by this BroadcastReceiver
.IntentFilter
protected void notify_list_of_peers_changed(WifiP2pDeviceList peers)