In the mean time the situation has changed. You can create a wifi direct connection fully automatic using creategroup() of the WifiP2pManager and the fetch the randomly generated password and SSID with onGroupInfoAvailable(), see this description with example code.