Get a network device name

时间:2016-10-15 17:03:06

标签: android networking network-programming

I know, from the mac address, how to get the manufacturer information but is there a way to get the device name. I attach a snapshot showing the view from my dsl router. Is it specific to a wifi protocol or is there a generic way to get that info? I'd like to get the name: bernard-ThinkPad-T420

enter image description here

1 个答案:

答案 0 :(得分:0)

我找到了答案。我没有意识到主机注册到dns。 所以这是代码行:

String host = InetAddress.getByName("192.168.1.1").getHostName();