0

i'm using the protocol for making p2p connection using wifi in android (http://developer.android.com/reference/android/net/wifi/p2p/package-summary.html)

I have a problem calling the discoverPeers() function :

ActionListener.onFailure(int reason) is called (its an interface to trigger some events) and i receive reason=1, which means 'P2P_UNSUPPORTED'. I added all the permissions required and the (use... wifidirect) tag.

i'm using a virtual device and the latest android sdk(4.0.3), i have an internet connection on this device.

<uses-sdk android:minSdkVersion="15" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses permission android:name="android.permission.INTERNET"/>
<uses-feature android:name="android.hardware.wifi.direct" android:required="true"/>

2 Answers2

1

As far as I know you can't run the demo in the emulator because it doesn't support real Wifi. You should launch the demo on a real device like the Galaxy Nexus which supports ICS and Wifi-Direct.

Fabien Demangeat
  • 935
  • 8
  • 12
  • ok , i'll try (if i have enough money to buy it). But i hope there is a way to make it work on AVDs –  May 01 '12 at 14:58
0

facepalm Yea...I was running on an emulator instead of the real deal...works fine if you use a device that ACTUALLY has Wifi...ha!

isuPatches
  • 6,384
  • 2
  • 22
  • 30