Sequenceablepublic final class IpInfo extends Object implements Sequenceable
IP information includes the IP address, gateway address, and DNS server address.
Sequenceable.Producer<T>| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getGateway() |
Obtains the gateway address of a Wi-Fi connection.
|
int |
getIpAddress() |
Obtains the device IP address of a Wi-Fi connection.
|
int |
getLeaseDuration() |
Obtains the IP address lease duration of a Wi-Fi connection.
|
int |
getNetmask() |
Obtains the network mask of a Wi-Fi connection.
|
int |
getPrimaryDns() |
Obtains the primary DNS server IP address of a Wi-Fi connection.
|
int |
getSecondDns() |
Obtains the secondary DNS server IP address of a Wi-Fi connection.
|
int |
getServerIp() |
Obtains the DHCP server IP address of a Wi-Fi connection.
|
boolean |
marshalling(Parcel out) |
Writes a
Sequenceable object into a Parcel for IpInfo. |
boolean |
unmarshalling(Parcel in) |
Restores a
Sequenceable object from a Parcel for IpInfo. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasFileDescriptorpublic boolean marshalling(Parcel out)
Sequenceable object into a Parcel for IpInfo.marshalling 在接口中 Sequenceableout - Indicates the Parcel object to which the Sequenceable
object will be written.true if the marshalling is successful; returns false otherwise.public boolean unmarshalling(Parcel in)
Sequenceable object from a Parcel for IpInfo.unmarshalling 在接口中 Sequenceablein - Indicates the Parcel object into which the Sequenceable
object has been written.true if the unmarshalling is successful; returns false otherwise.public int getIpAddress()
The IP address is an integer.
For example, 192.168.1.100 can be converted to the integer (192 << 24) + (168 << 16) + (1 << 8) + (100).
0 if no device IP address is available.public int getGateway()
The IP address is an integer.
For example, 192.168.1.100 can be converted to the integer (192 << 24) + (168 << 16) + (1 << 8) + (100).
0 if no gateway address is available.public int getNetmask()
The mask is an integer.
For example, 255.255.255.0 can be converted to the integer (255 << 24) + (255 << 16) + (255 << 8) + (0).
0 if no network mask is available.public int getPrimaryDns()
The IP address is an integer.
For example, 192.168.1.100 can be converted to the integer (192 << 24) + (168 << 16) + (1 << 8) + (100).
0 if no such IP address is available.public int getSecondDns()
The IP address is an integer.
For example, 192.168.1.100 can be converted to the integer (192 << 24) + (168 << 16) + (1 << 8) + (100).
0 if no such IP address is available.public int getServerIp()
The IP address is an integer.
For example, 192.168.1.100 can be converted to the integer (192 << 24) + (168 << 16) + (1 << 8) + (100).
0 if no such IP address is available.public int getLeaseDuration()
The lease duration (in seconds) is provided by the DHCP server.
If the DHCP server does not provide a lease duration, the default duration is 0xffffffff.
0xffffffff if the lease duration is not specified.