Reputation: 12018
I am trying out one example with of wifi-Direct for android.
I have run the the demo application on two different android phones.
Is it that both the application needs active wifi AP?
Is it necessary that we need to connect both the device to same wifi AP?
Is it that disabling wifi on the device will disconnect the wifi-direct session?
Can some one point me to one simple (basic) example of wifi-direct.
Upvotes: 3
Views: 4241
Reputation: 133
According to Android docs:
Wi-Fi peer-to-peer (P2P) allows Android 4.0 (API level 14) or later devices with the appropriate hardware to connect directly to each other via Wi-Fi without an intermediate access point (Android's Wi-Fi P2P framework complies with the Wi-Fi Alliance's Wi-Fi Direct™ certification program).
So, you don't need to connect to any access point. just enable wifi and start to search available devices to connect.
disable wifi will disconnect wifi direct connection.
here is my app shows wifi direct connection and transfer files.
https://github.com/Youxian-Chen/WiFiDirectTransfer
hope this helps.
Upvotes: 1
Reputation: 51
Android setting app can search and connect via wifi direct
4.0
setting app -> wireless setting other -> wi-fi direct (checked) https://android.googlesource.com/platform/packages/apps/Settings/+/android-4.0.1_r1.1/src/com/android/settings/wifi/p2p/WifiP2pSettings.java
if this activity didn't shows on your device, try create shortcut app, such as
https://play.google.com/store/apps/details?id=com.sika524.android.quickshortcut
currently disabled p2psettings activity on AOSP source code.
so i'm strongly recommended 4.1 later device.
4.1 later
setting app -> wireless setting -> (menu) -> wi-fi direct
my test app shows how to use wifi direct api.
https://github.com/kensuke/WiFiDirectTestApp
Upvotes: 2