mutltiple active Bluetooth connection connectivity android - android

Is it possible to connect a android mobile bluetooth with multiple bluetooth devices. And I need all the connection active at the same time and can transfer data at same time too.

Yes. You can connect the phone with up to 7 devices (in theory). They form a 'piconet' with the phone as the master.
If the phone initiates the connection to the first two devices then it will likely be the master (as necessary).
If you find that you are having problems connecting more then one or two devices then you should root your phone, and run 'hcitool' to determine which are slave and which is master.
Come to think of it, Nexus devices just got a new Bluetooth stack in 4.2 and I don't know if it supports hcitool. If not, hopefully they have created an alternative.

Related

Android Nearby Connection - Keeping wifi direct connection, reconnection with more than 4 devices

We're building an app for sending image payload between 1 to 4~5 devices using STAR strategy.
and we are keeping the connection as much as possible, and faster is better for sharing images along the devices.
As we tested more than 6 devices, after 4~5 devices connected to host device, link was not upgraded to wifi direct anymore. I guess it is restricted from code level for a performance.
But things happen when first connected device was reconnected. As our expect, when 3 devices connect to host and 1 reconnect device, it should be upgraded to wifi cuz wifi direct slots(?) are enough. But actually not. Somehow, it is treated as 5nd connected device so it cannot be promoted to wifi slot. even if we gave some minutes to be upgrade.
Is there a way to ensure that devices are maintained with Wifi direct?
There's no limitation within Nearby Connections for the number of devices we upgrade to WiFi Direct. Any limitations you're hitting are likely device specific.
I'd recommend looking at the logs (adb logcat NearbyConnections:* NearbyMediums:* *:S) to see if anything jumps out at you. They're quite verbose and relatively easy to follow along. If I'm right, and the problem is lower in the stack, turn on WiFi Verbose Logging and Bluetooth HCI Logs inside developer options (and then reboot), to get more logging at the platform layer.

Connect Android Tablets via cable/wire

I have 6 android tablets, and i want to connect them via a cable/wire, so that they can send messages to one another. (perhaps similar to way PCs may be networked with each other)
Once connected, apps running on the devices can exchange messages with each other via sockets or any other protocol. What are the best options?
Connecting devices over wi-fi is an option too, but then internet is not guaranteed in this scenario, and devices may be very far of from each other for any near field communication.
You can use usb->ethernet adapters and connect via LAN
Connecting devices over wi-fi is an option too, but then internet is
not guaranteed in this scenario, and devices may be very far of from
each other for any near field communication.
as long as all your devices and server (if any) are on same LAN or simply everything is connected to same hotspot you need not to worry about internet

Can BLE peripheral mode trigger the disconnection or refuse to connect?

Here's our situation. We have a machine vending machine run in peripheral mode and mobile runs in central mode. When the mobile is close to the vending machine, it triggers the connection and start to communicate. But as far as I know, the peripheral mode can only connect to one device at a time just considering bluetooh 4.0, so if there's someone who wants to make a trick stands around our vending machine and connects to it all the time, no one else can connect the vending machine. Am I right?
My question is
How to avoid this situation. Is it possible for the vending machine to refuse the connection or to trigger the disconnection when it founds that the connection is invalid (triggered by other app)?
I have heard something like multipoint bluetooth. So how much can the multi be, can it be like 100 so that it may solve the problem.
I found a similar situation in paypal beacon. https://devblog.paypal.com/how-does-paypal-beacon-work/ it says the beacon is running in peripheral mode. I am wondering how do they avoid these invalid connections.
Since, the central device(mobile device) initiating connection, it will act as Master and the other end device(vending machine) will act as slave.
According to Bluetooth 4.1 specification, a slave can have multiple masters.
So, more than one mobile device can connect to the single LE device.

How to build this android app (Bluetooth technology)

I am a little confused on how to build this android app. Here's how it should work. I have a list of paired bluetooth devices. Lets say paired devices are:
1. A bluetooth head set.
2. A mobile phone.
And my app should automatically connect only to my headset when ever it comes in range.
Thats the basic functionality. I have been doing some research on bluetooth technology and its implementation. I came across the bluetooth chat application, when I started using the application I realized that both phones should have the app on it in order to connect and exchange messages. I tried connecting to my headset but it doesnt connect. And also when I removed the bluetooth chat app from one of my device and tried to connect it from a device which had bluetooth chat app, the devices couldnt connect.
If you have already worked on bluetooth this might look very simple. But how can I connect to a bluetooth device from my app when ever its in range even if the other device doesnt have my app.
Thanks.
This will be a 2 sections answer:
-To connect to a Bluetooth Headset, check my answer on here
-To Always connect to that device, you can save device address to memory then create a service with BroadCastReciever that listens for Bluetooth Connectivity. and check which device gets connected and compare it address to the one save in memory once its finds it connected call ibth.connect(device). ibth is inside the above link.

is it ok to connect 2 devices concurrently to connect Bluetooth in Android?

Iam connecting 3G phone for my Android device for internet connection and another Socket(SPP) for CAN signal receiving.Whenever I manually connect to the Bluetooth tethering via 3G phone, i can browse internet perfectly and speed is good.Whenever programmatically connect to the 3G connection, i couldn't browse internet.i checked in shell and observing that in my mobile 'device is connected' message displayed and E symbol appears.No problem for me to connect Socket.But I got problem to use 3G phone.For this iam using APN/DUN mode.I checked both but no use.Is there any performance issue here or anything wrong to connect different devices by using Bluetooth API in android.Why this happends while connecting Mobile programmatically.Please give me guidance.
Regards,
Rajendar
Yes, you can have several open connections at a time.
In fact, I've used my hands-free bluetooth on my phone, as it is connected to my ELM327 SPP device streaming at full speed. I didn't notice any hiccups.
As for losing connectivity when you are connected to multiple devices, it's most likely an issue with the DUN provider you're using.
Also it's worth stating that, on Verizon/3g phones, when you use the phone as a phone, it suspends all 3g data services until the call is terminated.
The way L2CAP defines the LT_ADDR allows connecting devices up to 7. Your connection problems is something else.

Categories

Resources