I need to transfer files between Android devices using Wi-Fi Direct. Please give some sample code for this. I searched a lot, but I did not find two-way code.
https://github.com/mayfourth/WiFi-Direct-File-Transfer
Check it out and try the response code
I made an example application using the WiFiDirect demo provided by Android. But I made some changes when the user can transfer in both directions, from server to client, as well as from client to server.
Here is the APK file
You can download the code here.
I created a sample from
http://developer.android.com/guide/topics/connectivity/wifip2p.html
The following is a description of the process for performing this function.
Please find the file transfer demo at http://trivedihardik.wordpress.com/2012/08/31/android-wifi-direct-example/
Wi-Fi Peer-to-Peer: http://developer.android.com/guide/topics/connectivity/wifip2p.html
Creating P2P connections: http://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html
The Direct Direct WiFi app can be found in the SDK:
AndroidSDK\samples\android-19\legacy\WiFiDirectDemo