I have an requirement where i need to supply IP address and Port number of currently Connected Wifi network.
I am getting IP address
using WifiInfo
class having getIpAddress()
method.
But i am not able to get Port number.. Kindly provide an appropriate solution../
Portnumber of Wlan?
You are dooing right by using the WifiManager. There is no WLAN port that's why you can't get the portnumber.
来源:https://stackoverflow.com/questions/14749497/how-to-get-port-number-of-wifinetwork-active-currently-in-android