3

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:

  1. requestPeers() method callbacks onPeersAvailable().now how to implement that function?

  2. 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.

  3. 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.

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.