| In recent years, modern mobile communication devices have stepped into the field of multi-function and intelligent, Android OS has made an unprecedented development. With the improvement of intelligent terminal devices’hardware performance and the expansion of storage capacity, data sharing between phone users becomes more frequent. Nevertheless, as the mainly peer to peer wireless file transferring methods, Bluetooth can’t meet the demands of users due to its low speed and the inconveniency to handle. For the purpose, this paper put forward a new solution, aiming at implementing wireless p2p file transfer via WLAN instead of Bluetooth based on Android platform. This solution makes data sharing between Android devices more efficient and brings users higher quality of service. The main work of the paper includes the following points:(1)The design of Wi-Fi file transfer system. The software implementation of this system uses client/server model. The main idea is to establish a WLAN between two or more devices, then implement data transmission by socket net programming based on TCP, which is connection-oriented. Server acts as a wireless AP, it can connect and communicate with several clients at one time.(2)Research the solution of setting up wireless AP based on Android platform. Android OS starts to support wireless AP since its2.2version, however, this system can’t use the API of the OS because it aims at all versions of Android OS, which means the versions from1.5. This paper designs to call native WiFi driver interface by NDK tools, which need to distinguish different drivers on various devices.(3)The implementation of server and client, along with the communi-cation protocols between them. The server-side not only integrates the switcher of wireless AP, but also keeps waiting for the connecting and communication of clients in a new thread. Other phones act as clients then can connect to it and interchange data with it through client software, including file transfer and management. In addition, all operations obey to a set of defined commands, that is to say, the communication protocols.(4) Test and verify the implementation software. After a serious of debugging and optimizing, then package and publish them. Finally, the test with real phones turns out to be a good performance, meanwhile, verifying the innovation and practical value of this solution. |