A demo base on API which you can connect android device by wifidirect,and you can send file or data by socket,what is the most important is that you can set which device is the client or service.
Some people ask how to set who is the groupownwer,that is easy,you could set a button and use manager.createGroup before you manager.connect.