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.
Related
Is there a way to create an app for ios/android that can be smart enough to connect to (wifi / cellular) AND a bluetooth hotspot at the same time?
successfully managed to connect to the bluetooth hotspot and access data however when the phone is on bluetooth it cannot access the internet through cell or wifi
Needs to be able to connect to a bluetooth devices hotspot and access its local host aswell as be able to connect to the internet through wifi/cell at the same time
Or if there is a way to tell the app that any request to the IP of the bluetooth device will go via bluetooth and all other requests through wifi
the worst idea so far - alternate connection between wifi and bluetooth so that both never work at the same time. Possible app permissions nightmare
ideas welcome
I know that there are ways to share internet via:
Creating a hot spot on the mobile phone
Bluetooth tethering?
NFC tags
However all these processes require some manual effort on the user side.
I am wondering if there is a way to seamlessly do this for the user the moment we pair with their peripheral device over BLE. Is there a way I can programmatically share the Wi-Fi connection the moment we are successfully connected?
Use Case:
I have a new speaker that can connect over BLE
I successfully pair my phone with the speaker over BLE
My speaker after pairing also automatically joins the same wifi network as my phone after
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.
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.
Can someone explain a couple of very simple concepts to me - I'm interested in mobile devices running android and how they are identified over networks. Some scenarios:
Device is connected over WiFi - presumably the device has a standard IP address as with any host and can communicate with any other android host over TCP/IP (assuming it knows the participating device's IP?
Device is connected over bluetooth - how are devices identified in this case?
Device is connected over mobile operator's network - this is the one I'm interested in and confused by - is there anyway for two or more devices to discover each other and communicate via the mobile operator's network? How does a device communicate with a backend server in this scenario? In other words, how do apps and devices communicate when not connected to a WiFi network?
Thanks for any advice..
I'm only sure about the bluetooth thing, so i only answer this part:
The Bluetooth interface on your device has an MAC adresse. So while communicationg over Bluetooth you can assume that this MAC adresse is a unique identifier for a specific device. You can also reach other devices by establishing a connection over this MAC adress- However, to get this mac adress in the first place, you have to know it from somwhere, or you have to search for other bluetooth devices in the reachabla area before.
WiFi and 3g both attach the [mobile] device to the internet so it can make internet connections. 3G assigns a publicly addressable IP to the device, so one could, presumably open a server socket and listen for connections. The client would have to know the mobile IP, which may change quite frequently.
Bluetooth is more geared toward close-proximity. Devices in the vicinity can be connected to, after you have paired with them, which requires the cooperation of both devices which are to communicate.
If the goal is to produce an application which connects to nearby devices, I can think of the following ideas:
3g: all devices running the client register their position with a central database server. If the server detects that two clients are in close proximity, let them know so they can connect through the internet or through the server
WiFi: you could use the same idea as 3g, or use broadcast/multicast packets to broadcast your presence. Other apps can listen for those broadcasts and discover which other devices are near.
Bluetooth: A little trickier, as a device must be placed into discoverable mode in order for others to "see it". Discoverable mode is a temporary state and only lasts about 30 seconds (at a time).