Question

In the new Ice Cream Sandwich SDK (4.0), there is a new section of the API for creating p2p connections over wifi. There is plenty of information in the WifiP2pManager class on how to connect and discover peers and peer groups, but very little detail on how to send data after a connection is established. It says:

The connection info WifiP2pInfo contains the address of the group owner groupOwnerAddress and a flag isGroupOwner to indicate if the current device is a p2p group owner. A p2p client can thus communicate with the p2p group owner through a socket connection.

I don't have a ton of experience with creating socket connections. What would be needed for a peer to send data, and for a peer group owner to receive it, just from the WifiP2pInfo or connection methods?

Was it helpful?

Solution

Being new, there isn't a lot of information on this, but the sample application from the android developers resources is a fantastic demo project that gave me everything I needed to know.

WiFiDirectDemo Project

With the WiFiP2pInfo, you can open a socket for data transmission. It has an example for sending files in the demo.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top