Creating and connecting a new Ad-Hoc network is hard to implement. Also, in case of being in range of multiple Ad Hoc wireless networks there is the question of choosing which to connect.
Recommendation: Create & connect the network manually. Use the network as is in the application.