public class WifiP2pGroup
extends Object
implements Parcelable
java.lang.Object | |
↳ | android.net.wifi.p2p.WifiP2pGroup |
A class representing a Wi-Fi P2p group. A p2p group consists of a single group owner and one or more clients. In the case of a group with only two devices, one will be the group owner and the other will be a group client.
See also:
Inherited constants |
---|
![]() android.os.Parcelable
|
Fields |
|
---|---|
public static final Creator<WifiP2pGroup> |
CREATOR Implement the Parcelable interface |
Public constructors |
|
---|---|
WifiP2pGroup() |
|
WifiP2pGroup(WifiP2pGroup source) copy constructor |
Public methods |
|
---|---|
int |
describeContents() Implement the Parcelable interface |
Collection<WifiP2pDevice> |
getClientList() Get the list of clients currently part of the p2p group |
String |
getInterface() Get the interface name on which the group is created |
String |
getNetworkName() Get the network name (SSID) of the group. |
WifiP2pDevice |
getOwner() Get the details of the group owner as a |
String |
getPassphrase() Get the passphrase of the group. |
boolean |
isGroupOwner() Check whether this device is the group owner of the created p2p group |
String |
toString() Returns a string representation of the object. |
void |
writeToParcel(Parcel dest, int flags) Implement the Parcelable interface |
Inherited methods |
|
---|---|
![]() java.lang.Object
|
|
![]() android.os.Parcelable
|
WifiP2pGroup (WifiP2pGroup source)
copy constructor
Parameters | |
---|---|
source |
WifiP2pGroup
|
int describeContents ()
Implement the Parcelable interface
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
Collection<WifiP2pDevice> getClientList ()
Get the list of clients currently part of the p2p group
Returns | |
---|---|
Collection<WifiP2pDevice> |
String getInterface ()
Get the interface name on which the group is created
Returns | |
---|---|
String |
String getNetworkName ()
Get the network name (SSID) of the group. Legacy Wi-Fi clients will discover the p2p group using the network name.
Returns | |
---|---|
String |
WifiP2pDevice getOwner ()
Get the details of the group owner as a WifiP2pDevice
object
Returns | |
---|---|
WifiP2pDevice |
String getPassphrase ()
Get the passphrase of the group. This function will return a valid passphrase only at the group owner. Legacy Wi-Fi clients will need this passphrase alongside network name obtained from getNetworkName()
to join the group
Returns | |
---|---|
String |
boolean isGroupOwner ()
Check whether this device is the group owner of the created p2p group
Returns | |
---|---|
boolean |
String toString ()
Returns a string representation of the object. In general, the toString
method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@
', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
a string representation of the object. |
void writeToParcel (Parcel dest, int flags)
Implement the Parcelable interface
Parameters | |
---|---|
dest |
Parcel : The Parcel in which the object should be written. |
flags |
int : Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . |