How do you connect an Android 4.0.3 phone to a Wifly module using level 14 API function wifi direct
? I configured Wifly to work in adhoc mode, and wrote the Android app as shown in the Android.developer guide but I can not find the peer.

- 6,325
- 6
- 43
- 60

- 11
- 2
3 Answers
Since Android 4.0, it is possible to connect an Android phone to a Wifly module in adhoc mode, without rooting, with the following technique:
- With a helper app (available on Google Play or develop your own), create an Access Point on the phone and inspect the SSID, passphrase and IP address.
- Configure the Wifly module with this info.
- In your working app, communicate with the Wifly module through standard socket programming.
These 3 steps are described in the following posts:
http://sailboatinstruments.blogspot.ca/2012/10/talking-to-android-phone-through-wi-fi.html
http://sailboatinstruments.blogspot.ca/2012/11/gps-data-from-wifly-to-android-phone.html
http://sailboatinstruments.blogspot.ca/2012/11/gps-data-from-wifly-to-android-phone_28.html
The current limitation is that the SSID and passphrase are given non-editable random names, so that you have to reconfigure the Wifly when you create a new AP (but note the AP will live on the phone as long as Wifi is enabled, unless you remove it with the helper app). Let's hope that a future Android release will remove this limitation by allowing to keep a permanent SSID and passprase.
UPDATE: With Android 4.2.1, the above limitation seems to have disappeared! The SSID and passphrase remain the same when the access point is removed and recreated.

- 56
- 4
Its not possible to work with AdHoc mode devices via Android (in iOS you can) in normal ways.
Please read here: http://www.xda-developers.com/android/android-ad-hoc-wireless-network-support/
This link shows a way to work with AdHoc.

- 1,262
- 9
- 28
Auto-connect: https://dl.dropboxusercontent.com/u/101922388/WiflySanUSB.zip .When only the green LED of the WiFly modem is blinking, the circuit and the program has been successfully implemented.

- 1