如何在Android手机上将主机名解析为IP地址?我没有访问/system/etc/hosts文件的权限。
发布于 2016-06-08 07:37:36
InetAddress可以为您做到这一点:
String ip = InetAddress.getByName("stackoverflow.com").getHostAddress();
// result e.g: "151.101.129.69"这也需要在后台线程中完成。
https://stackoverflow.com/questions/37690790
复制相似问题