I got struck in my app in a part where i need to share data using wifi between two android device. the app is actually a turn-wise multiplayer game like chess and i cannot find how to make the connection part..so help me how to use wifi p2p connection. i already read http://developer.android.com/guide/topics/connectivity/wifip2p.html but i cannot understand these parts:
requestPeers() method callbacks onPeersAvailable().now how to implement that function?
onPeersAvailable() returns WifiP2pDeviceList object..now if i want to show it in a listview how can i convert it into a ArrayAdapter or something else to display it.
in client side code
socket.connect((new InetSocketAddress(host, port)), 500);
this function is called. how does this works? does it get the server ip address automatically? Note: host,port are two int that is declared but not assigned any value in the site.i have no idea whether i have to find out the value of host, port or is it automatically chosen in InetSocketAddress object.