Sharing files between two devices using WiFi can be done by using WiFi direct or creating a hotspot on one device and connecting other device to it.
What is the basic difference between these two methods? In both the options, one device serves as the access point while the other connects to it.
Which among the two devices will serve as the access point in the case of WiFi direct?
One basic difference in usage is that if you use access point approach, any other access point can not be used same time, meaning that if user had existing connection through some access point, it will be terminated.
Also if there are apps looking for internet connectivity, they might start pushing data as soon as you make a access point connection to the other device, which might pose some security issues (in case the other device has some sniffers ready for sensitive data etc.)
With WiFi direct, there are no such things as access points, Basically you find a WiFi direct device, and start connection to it. With first creation of the WiFi Direct Group, there is dialog shows for accepting incoming connections (so its always shown in the party we are making the connection to).
Then when the connection succeeds, one of then devices are chosen to be Group Owner, and any other devices wanting to join the group, should then make connections to the group owner only.
With WiFi Direct API, you can also use CreateGroup, to pre-select one device to be group owner, This option would also create a Access point with random password.Thus if you want to go with Accesspoint option, you could use this feature for it easily.
Answered By – Dr.Jukka
Answer Checked By – Willingham (FlutterFixes Volunteer)