For this you will need a usb wireless adapter which has the atheros chipset like the TL-WN722N.
After you install this deb: deb link
Your beagle bone or rpi will run a hotspot, which can easily connect from your phone.
Then open a browser and surf to http://name:8081 you will get a welcome page asking for your wireless network name and your password to it.
Click connect and it will try to connect to your network.
The hostspot remain active so you can change the connection details.
This GPL-3 and the sources are now at gitlab