Getting IP addresses of the PC's available on wifi network in android

旧城冷巷雨未停 提交于 2019-12-06 14:23:34

问题


I am able to establish connection between android and PC via Wi-fi. But this is done by hard coding the the IP address of the PC (server) in the android program. But I wanted to get IP addresses of the PC's available on the Wi-fi network programmatically. So please let me know how to scan for PC's on the network and get their respective IP address.


回答1:


can you not multicast a UDP packet on the network which the server listens for and responds to with a packet containing the ip address of the server in order to set up the connection?

You should be able to find help on that topic, with some options here here and here



来源:https://stackoverflow.com/questions/9504721/getting-ip-addresses-of-the-pcs-available-on-wifi-network-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!