How to detect all the Devices connected in a WiFi network from Android App

前端 未结 3 1583
情书的邮戳
情书的邮戳 2020-11-29 22:34

I am developing an app in which I need to scans WiFi network and display the list of all connected devices.

Allow a use to tap on a device and the app should show al

相关标签:
3条回答
  • 2020-11-29 22:54

    Check requestPeers of WifiP2pManager

    As per documents it seeks PeerListListener which returns WifiP2pDeviceList carrying list of WifiP2pDevice which carries deviceAddress, deviceName, primaryDeviceType, secondaryDeviceType, status and other attributes.

    0 讨论(0)
  • 2020-11-29 23:02

    In my opinion, you can use Wi-Fi Peer-to-Peer

    https://developer.android.com/guide/topics/connectivity/wifip2p.html

    "Wi-Fi peer-to-peer (P2P) allows Android 4.0 (API level 14) or later devices with the appropriate hardware to connect directly to each other via Wi-Fi without an intermediate access point (Android's Wi-Fi P2P framework complies with the Wi-Fi Alliance's Wi-Fi Direct™ certification program). Using these APIs, you can discover and connect to other devices when each device supports Wi-Fi P2P, then communicate over a speedy connection across distances much longer than a Bluetooth connection. This is useful for applications that share data among users, such as a multiplayer game or a photo sharing application." Blockquote

    0 讨论(0)
  • 2020-11-29 23:13

    Maybe the Network Discovery github project could help you. It lists all users connected to WiFi with IP and MAC addresses and gathers even some information like open ports, device name, ping, etc. Hope it helps

    0 讨论(0)
提交回复
热议问题