I need to develop an android app for communicating tablet wireless. After some google search i found Wifi direct (Wifi P2P) is the solution for that. I have some doubt about this. I found wifi direct option in some Samsung device only.
Is every android device after ICS support Wifi direct? If possible how can i enable wifi direct service in those devices.
If not, Which are the wifi direct service available devices?
Can i create one to many network using wifi direct ?
WiFi direct is supported by most devices with Android 4.0 and above, and you can create one-to-many network with it.
Related
i'm working on a wireless ad hoc network, at the moment i still designing my network.
The network should work for android devices.
Until now i thought to use a phone as a hotspot, so nearby devices could connect each other, but what if two hotspots have to speak to each others?
Basically the question is: Can two or more hotspots connect and communicate each other?
Thank you.
Yes, you need to use WiFi Direct for this. When using WiFi direct in concurrent mode, and device can act as both a client and an AP the same time. This is what you need. Whether it will work for you as is, depends on your specific device and driver, but there is support for WiFi Direct in Android since v4.0. Sometimes WiFi Direct is also called WiFi Peer-To-Peer or WiFi P2P and this is what the Android API calls it.
see Android WiFi P2P
With the Android API you can discover other peers and services you define and connect to them.
The WiFi p2p utilities are under very active development, so I am not sure if the Android is currently supporting the concurrent mode. You can try. However, you can also setup your connections directly by using the wpa_supplicant utility which is actually what Android is using internally. I have been able to use this directly from my applications for other purposes. If the version that Android is using is not working, or if you find it a bit unstable, you can get the latest version from the hostap and wpa_supplicant projects. Installing those may require root access though.
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.
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
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.
In API 14 or higher (ICS), ad-hoc wi-fi networks are possible. I currently possess the following, and I'm trying to figure out how I might test the wi-fi direct functionality, or if I need to get another device with Android 4.0.
Computer, connected via a wired network to a wi-fi router.
A Galaxy Nexus, fully update.
The problem is that from a User Experience prospective, Wi-Fi Direct functionality in Android is quite crappy. Yes, it does have an API for negotiating and controlling Wi-Fi Direct connections, but "vanilla" Android doesn't have any user applications for negotiation this connection if user need it.
If yo are software developer and developing multi player game Android game, you have everything you need:
API to enable Wi-Fi Direct
to receive list of all devices nearby with enabled Wi-Fi Direct
to send connect request to another device
to accept this request and establish connection
But if you are just a user who has two devices and multi player games which can't negotiate about establishing Wi-Fi Direct connection, and and just want to connect two devices without Access Point, we are sorry.
So, if you just want to test Wi-Fi Direct functionality on your device, there are two ways to do this:
Buy / borrow device which has appropriate software "from the box", like Sony Xperia T, Samsung Galaxy SII or Samsung Galaxy SIII.
Install third party application from Android Market, like WiFi Shoot!, WiFi Direct, etc.
Hope I answered your question.
Since I don't have an Android 4.0 device I haven't been able to test this myself. Also I wonder if connecting device A (a smartphone) to device B (a wifi direct capable device) using Wifi direct would mean that device A would assume it is provided with internet from device B (tethering?). I am trying to make an application for device A that would communicate with a device B that does NOT provide internet, thus it would be interesting to know if such a scenario would lead to device A losing internet connectivity for the duration of the connection. Is the situation different depending on if device A is connected to internet through an AP or through 3G/4G?
Perhaps using Bluetooth would be a solution, but in my case security is an issue, and it seems to me that Wifi direct provides stronger security (WPA2).
Any info would be helpful!
/S
On Android, Wi-Fi Direct doesn't interfere with your connection to the Internet (Wi-Fi or 3G/4G). A problem may be that once your turn on the Wi-Fi (to enable Wi-Fi Direct, your phone will try to connect to one of the saved available networks and will disable your 3G connection. That is because Android (by default) doesn't support dual connection (via both Wi-Fi and 3G/4G), but there is some applications around that claim that they can provide such functionality.
Is it possible to connect two android phones (rooted) with wifi programatically and exchange data?
I know it is possible to do tethering using wifi-android-tether. But i need to establish the connection, and exchange the data, all through my android application. User intervention like switching on the android tether app manually is not allowed.
SO basically its like, if i run my app on two droid phones, they should do the following,
Detect that they have wifi.
DEtect that the other phone has its wifi on.
Establish a connection ( similar to a PAN in bluetooth ).
Exchange some data.
Use WiFi Direct. The sample codes in the SDK package will do for testing Peer-Peer connectivity.