Question

I've been playing around with the Wifi Direct API on ICS and i'm a bit stuck.

In the API there is a method called createGroup that creates a legacy software based access point on the phone. This is great and works but i can't seem to find any way to change the password or any configuration options for it! Does anyone know how you configure it?

Link to API Docs: http://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager.html

Was it helpful?

Solution

Found out you can't configure it. It picks a random AP name and a random password.

Source: https://groups.google.com/forum/?fromgroups=#!searchin/android-platform/direct/android-platform/YrKKfEMACZk/zV-8AsJp6pgJ

OTHER TIPS

You could print out adb logcat messages and the password will be printed.

For example, here is what I got "I/wpa_supplicant( 386): p2p0: P2P-GROUP-STARTED p2p-p2p0-0 GO ssid="DIRECT-iU-Android_c38f" freq=2437 passphrase="EvYmhRs3" go_dev_addr=a2:0b:ba:e9:c3:34"

I've tried to connect to this network using the above password and it works.

If you have root, you can modify /data/misc/wifi/p2p_supplicant.conf and then pkill wpa_supplicant to apply changes. This should work on most devices. Example code: https://github.com/Mygod/VPNHotspot/blob/ad0d5b8b5a8d96a2f7e0d07885375c804ea5265b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/P2pSupplicantConfiguration.kt

Update: You can do this in Android Q (at least up to beta 3). See this: https://github.com/Mygod/VPNHotspot/blob/ec6f7870d470f9f6b6037610bbff9c6fc061908b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterService.kt#L288-L319

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top