KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How can you find the IP address of the router (gateway address) from code? WifiInfo.getIpAddress() - returns IP address of device. In a shell command "ipconfig" does not return any value. Here is my solution, but please let me know if there is a better way to do this: WifiManager manager = (WifiManager)getSystemService(WIFI_SERVICE); DhcpInfo info = manager.getDhcpInfo(); info.gateway;
Tags (comma-separated)
Save Edits
Cancel