androidwifilan

Create a LAN Access Point on Android device (no Internet needed)


I need to implement the following functionality:


Is it possible to implement such a functionality? Currently, I've only managed to set up a web server on the device using nanohttpd, but it doesn't seem to be the correct path for doing what I need. I've read some similar questions on SO but either didn't understand the concepts or just couldn't find the appropriate answer.

If it is possible, how should I implement it? Is there anything that I could read about solving a similar problem? Or, maybe, someone has already faced something like that and has some experience with dealing with such a task?

Any help is very appreciated.


Solution

  • It sounds like wifi direct is what you're looking for. Using WifiP2PManager.createGroup() will allow a device to act as a wireless router if you will, allowing other devices to connect to it as if they were connecting to wifi.

    Be warned you will not be able to connect to the device's wifi signal without the random passphrase generated by the device. You can find the passphrase by calling WifiP2PManager.requestGroupInfo() and passing a GroupInfoListener. Calling getPassphrase() on the WifiP2PGroup.