I'd like to know if on Android, just in case I'm connected to a WLAN when i start a p2p connection with wifi-direct, the WLAN gets disconnected or not? Can wifi-direct work even if a WLAN is active? Is there any exception?
Thanks!
At a very high level it depends on the Wi-Fi hardware capability. Some hardware supports multiple roles (legacy wifi, p2p) simultaneously and some don't.
Related
This is hardware related question. But also software related.
I am making an Android app using bluetooth. And I tested my devices with wifi and bluetooth.
And the result is:
1. Wifi ON, connected & Bluetooth ON(possibile)
2. Wifi ON, connected & Bluetooth ON, connecting to bluetooth product such as ear buds (possible)
3. Wifi ON, connected & Bluetooth ON, connecting to other mobile devices (impossible)
4. Wifi ON, disconnected & Bluetooth ON, connecting to other mobile devices (impossible)
When I try 3 and 4 cases. I get a popup message
Can't use Bluetooth tethering while connected to Wi-Fi network
I'd like to make an app that send data between two devices. And each device might be connected to Wifi.
For example, the app uses Bluetooth to connect other mobile phone and also internet for getting & sending data to the server.
At that time, the internet connection could be Wifi. So, It shouldn't be disconnected.
One of the reason that I found says Bluetooth uses 2.4Hz, and it is the same Hz of 802.11.
according to here, It's kind of true.
It says,
802.11 Provides up to 2Mbps transmission in the 2.4GHz band
802.11b Provides up to 11Mbps transmission in the 2.4GHz band
802.11a Provides up to 54Mbps transmission in the 5GHz band
802.11g Provides up to 54Mbps transmission in the 2.4GHz band
802.11n Provides up to 450Mbps transmission in the 2.4/5GHz band
However, I don't get it because we can connect it to wireless ear phones over Wifi.
Could you explain its behaviour? And what can I do? Or should I just make an app that uses only Bluetooth without wifi?
I would like to make a game which takes place in the forest (around 2 hectares). The players(around 30) must have their phone connected to a router via wi-fi so that every players are connected to each others via LAN.
But I don't know how to make this possible.
Wifi mesh routers ? Helium baloon that spread wifi above the forest ?
Using Network Service Discovery you can achieve this. You need a wifi router to connect all the devices. One device will be a host and others will be a client.
Go through this link https://developer.android.com/training/connect-devices-wirelessly/nsd.html
The question is kind of broad, but here are my attempts at possible solutions
Have you thought about using wifi-direct between the devices? One possible implementation of this is to have a central router, some older phones/devices spread out in the forest connected to the router and eachother through wifi-direct. Then the players running around will be covered
"Wi-Fi Direct, initially called Wi-Fi P2P, is a Wi-Fi standard enabling devices to easily connect with each other without requiring a wireless access point.[1] Wi-Fi Direct allows two devices to establish a direct Wi-Fi connection without requiring a wireless router. "
https://en.wikipedia.org/wiki/Wi-Fi_Direct
If data is not an issue, and service is okay, probably better to connect them to a cloud through their regular data connections.
I am just getting started with wifi direct. I know that wifi direct works by discovering devices and services. My question is: if I have my wifi enabled on my smartphone and I am not running an application that uses wifi direct, is my phone still discoverable to a phone that is running wifi direct device discovery?
Thanks!
In order to establish a WiFi Direct connection both phones should be running WiFi Direct discovery. In other words, they will see each other when they are both scanning for WiFi direct connections at the same time. This is because the way WiFi Direct works is that when phones are scanning for WiFi Direct connections, they will negotiate with the other peers for the role of Access Point or Slave device. However, when phone A is connected to phone B via WiFi Direct and phone C is scanning for connections, it will detect the connection of A-B since one of them is acting as an Access point.
I will add some point on #Ziad answer. During scan process, one device who started scanning will broadcast 802.11 WiFi Direct probe request and another device will listen to that probe request and send back the probe response, that how they will discover each other.
Scanning will happen on one channel 1, 6 ,11 on 2.4 GHz.
I am maintaining a small app related to wifi networks. It tests internet connectivity when the phone connected to a wifi network.
While testing and using the app in a place with two neighbouring wifi networks (different SSIDs) with slightly overlapping coverage with a HTC Desire running Android 2.2.2, the sequence of disconnecting and connecting when moving from wifi A to B seems to be:
Disconnect from wifi A
Connect to wifi B
Now with a Fairphone running 4.2.2, the sequence seems to be:
Connect to wifi B
Disconnect from wifi A
Does this mean that unlike the HTC Desire, the Fairphone does some sort of roaming and first connects to the wifi whose signal became stronger than the one of the current wifi connection, and then drops the "old" wifi connection?
I am asking this question because if my observations are correct, this has some implications on the app's behaviour, i.e. it should not consider the last wifi connectivity event but rather check the actual state of wifi connectivity regardless if the last event was "connected" or "disconnected".
On android, as on many linux flavors, wpa_supplicant controls roaming behavior. You could look into it so to see what it is doing.
Specifically to answer your question, it is possible for a WLAN Device (in linux), to use different types of drivers:
SoftMAC: MLME (Media Access Control (MAC) Sublayer Management Entity) is managed in software.
FullMAC: MLME is managed in hardware.
Particularly some of the MLME functions are:
Authenticate
Deauthenticate
Associate
Disassociate
Reassociate
So differences are to be expected in some of this mechanisms on different devices and versions of Android (driver types, wpa_supplicant).
The correct 802.11 behavior for roaming is to send an Reassociation request to the newly selected AP. Clients that first Disassociate from an AP to later Associate with a new AP actually do not support 802.11 roaming and use some sort of fake-roaming through a SoftMac approach.
In standard roaming packets sent to a station do not get lost and are forwarded from one AP to the roamed AP in order for the roaming station to receive them.
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.