5

I want to create a connection where one device will be like server which will stream some data to connected and multiple device can connect to that device which receive data.

So i have done some kind of research i got to know that we can do this using network service discovery and WiFi peer to peer, So i have made the connection where i can connect one device and stream data also but i want to create a group to connect multiple device ,So any help from any one would be appreciated.

Thanks!

Nikhil Sharma
  • 593
  • 7
  • 23

1 Answers1

5

WiFi-Direct or Wi-Fi Peer to Peer can do multiple device connection.

See this link to read more about P2P connections -https://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html

WiFi-Direct automatically select which device will be the Group Owner or the server base on which device is the most compatible to be the Group Owner or the server. But you can manually select which will be the Group Owner by setting WifiP2pConfig groupOwnerIntent = 15(the highest value).

If two devices are connected, when you connect another device this device will connect to the group owner(or server).

For you to able to send streams to client devices you can use java Sockets. When peer to peer connection is established, the group owner will be the one to handle the server socket and client socket for the client devices.

If you have multiple devices and you want to send a message to a specific client device you'll send it to the server and the server will send it to the specific client. see this link - WiFi Direct (Android 4.0) with multiple (3+) devices

Community
  • 1
  • 1
  • Thanks for your reply and in case i want to connect or send file to iphone device how i can do because iphone doesn't support wifi direct – Nikhil Sharma May 04 '17 at 06:55
  • "If two devices are connected, when you connect another device this device will connect to the group owner(or server)." @Michael Angelo Reyes, for this, where can find the document? or this is by your experience? – Amos Oct 18 '18 at 09:57
  • How can you share your internet on wifi direct? – phani Dec 11 '18 at 15:28