Get Android DhcpInfo connected via Ethernet
问题 How to get DhcpInfo() (gateway ip, netmask, dns, etc) of android device connected via Ethernet? I know how to get it if device connected via Wifi and using ACCESS_WIFI_STATE permission: WifiManager wifi = (WifiManager) context.getSystemService(Service.WIFI_SERVICE); DhcpInfo dhcp = wifi.getDhcpInfo(); But I still not found the way to get it if device connected via ethernet... Thanks 回答1: In your AndroidManifest.xml file <uses-permission android:name="android.permission.INTERNET" /> <uses