Why can't use Bluetooth and Wifi simultaneously? - android

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?

Related

Android - Is there a way to share a Wi-Fi connection with a connected peripheral device over BLE seamlessly?

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

When two Bluetooth devices are connected, does either of them reply to any Inquiry scan, or send an Inquiry?

I am trying to answer the following question?
When two Bluetooth devices are connected, does either of them reply to any Inquiry scan, or send an Inquiry?
I had a few experiments and my answer is no. I connected two BT devices and try to pick any BT device nearby by my other phone which it did not detect any of them.
It would be great if you could also support your answer by a referencable document.
I have looked at several docs like these:
http://essay.utwente.nl/59681/1/MA_scriptie_A_Franssens.pdf
https://link.springer.com/content/pdf/10.1007%2F978-0-387-75462-8_20.pdf
but could not find a straight answer.
Yes, Bluetooth device can scan/enquiry and send scan/enquery response when connected. However, most cells designed so that it can be discovered only when you have Bluetooth settings opened. This is not Bluetooth limitation but OS design.
If we are talking about headsets (or keyboard or any other HID device) then this is reasonable why manufacturer made it so it can pair/work with only single device. But this is just a manufacturer decition and made so by design. It is not Bluetooth limitations. If you need you can design such headset that can be paired and connected to few devices t the same time.
On high-level Bluetooth device can be in Discoverable and/or in Connectable modes. Discoverable mode makes device visible to other devices. Connectable mode allows to connect to the device.
Usually manufacturer design it so that is device is not paired (or when you press special button or open Bluetooth settings on cell) it stays in Discoverable mode. So other devices can discover (find) the headset/cell. Once you paired with your device the Discoverable mode switched off. So now you can connect to device (cause during pairing the MAC is stored and you do not need to rediscover the device).
Once you connected the device turns Connectable mode off so others can't find and connect to it.
But once again. This is how manufacturer designed device. It is not Bluetooth limitation.
Bluetooth Core Specification
I know that you can connect and interact with multiple bluetooth low energy devices without problems. I myself connected to at least three ble devices and could easily receive and send data.

Bluetooth to wifi pass through, not tethering, and not wifi to bluetooth

Im wondering if there's a way of bridging or using a 'pass-thru' to send data from a bluetooth connected device over wifi to another android device.
The real world scenario is;
I have a bluetooth OBD device (for reading your car specs in real-time)
This connects fine over bluetooth to my android phone running any OBD software.
But i also have an android based in car unit (gps, reversing cam, etc) but oddly enough it doesn't have a bluetooth radio/chip in it, only wifi.
So im wondering if it would be possible to run an app on the car unit and my phone to 'in essence' pass on the bluetooth data. Emulating a bluetooth radio on the car unit.
I know it can be done in reverse for tethering a data connection over bluetooth, but why not the other way around?
Other situations could be sharing a bluetooth device connected to one phone over wifi to many different phones???
Sounds plausible to me, but you guys are the experts!
What say you?

Wifi Direct discovery

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.

Android - modes of connectivity, device identification and device inter-communication?

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).

Categories

Resources