I am working with a firmware team that writes firmware on a QCC3056 Qualcomm chipset that supports earbuds and I develop an android application that supports the BLE earbud Bluetooth device. The earbuds also support google fast pair and this feature requires the BLE mac address to be rotated every 15 min.
So the issue I am seeing here is the android Bluetooth settings recognize two Bluetooth devices with the same name(one is classic and the other one is BLE). I can tell by the mac addresses that one belongs to classic and the other belongs to the BLE address. We are able to connect to the classic instance. However, we are unable to connect to the BLE instance. We would like just one name to show up and the user should be able to connect to it. The firmware team thinks this is expected behavior(two names showing up). As far as I know, from the android end, we don't have any control over the Bluetooth settings. So I wanted to understand if this behavior is expected. I have tested this scenario with SONY WF-1000XM3 which supports Google Fast Pair and I have noticed only one name showing up.
It would be great if anyone can suggest the best possible approach I can take here.
Related
I want to connect two android phone only via BLE. Is it possible? because as per my understanding using Android API I can only connect with BLE enabled devices like smartwatches headphones etc. If I run startLescan() method it only shows my fitness band and headphone.
It does not show other android phones.
Yes its possible. As the hardware equally supports to act as a master or slave, but it depends on whether the OS has provide you the required interface to make a device act as master as well as slave. THe BLE in android phone is equally capabale of becoming a master or peripherical but it depends on whehter android has exposed some interface to make it work ortherwise if not you have to root/reflash your device and make changes at OS level.
Yes, two BLE devices can communicate and has been ever since the original 4.0 release.
The change in 4.1 states that a single device can act as both a master and as a slave simultaneously to two different devices. Once device has to act as periphiral and other as master.
See this: http://www.blemobileapps.com/ble-mobile/
For android this link might be helpful for you: https://code.tutsplus.com/tutorials/how-to-advertise-android-as-a-bluetooth-le-peripheral--cms-25426
Reference: Chipsets/Devices supporting Android 5 BLE peripheral mode
Let me know if this answers your question.
It is possible to connect to Android phone with BLE.
One of the phones has to be a BLE Server and must advertise itself
(a role usually performed by devices like smartwatches and headphones) to be discovered by the other phone.
To advertise itself the app uses the BluetoothLeAdvertiser class.
Such API was added starting from level 21 Lollipop so your server phone should be at least a 5.0 Android device.
Personally I found this tutorial by Andrew Lunsford very useful for understanding how to realize such functionality.
I'm doing some simple scanning + advertising testing on bluetooth LE feature for Android using this sample-code
I'm testing it using a Samsung 6 and a Nexus 9, and for some reason if I leave the app running on the Samsung and restart the app on the Nexus, the next time the Samsung devices finds the other device, it has a different address.
In code:
On the device:
The funny thing it doesn't happen the other way around. (Samsung always has the same address when discovered from the Nexus 9)
Is this a common behavior between devices?
Is there another way to identify a specific device besides it's mac address?
As CommonsWare mentioned, as of Android 6.0, Android has removed access to the hardware address programmatically, and made it so that the address appears to be randomly generated to scanning devices. The change log can be found here:
http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id
The fact that scanning devices see a random Bluetooth address rather than the actual one is a highly useful privacy feature. It was adopted by the Bluetooth specification as of BTv4.0 and is known as LE privacy:
"This feature causes the MAC address within the advertising packets to be replaced with a random value that changes at timing intervals determined by the manufacturer. Any malicious device(s), placed at intervals along your travel route, would not be able to determine that the series of different, randomly generated MAC addresses received from your device actually relates to the same physical device. It actually looks like a series of different devices, thus, it will not be possible to track you using the advertised MAC address"[1]
You can find a similar question here:-
Since marshmallow update Bluetooth discovery using BluetoothAdapter.getDefaultAdapter().startDiscovery(); is broken
[1] http://blog.bluetooth.com/bluetooth-technology-protecting-your-privacy/
I want to connect a 3rd party bluetooth device to my Android Wear watch (Samsung Gear Live). I am trying to find documentation on how to do this but I am not having any luck. All the searches I do seem to think I want to attach to a phone.
Does anyone know of a good example that shows how to connect, for example, a bluetooth heart rate monitor (or other device) to the Android Wear so I can keep a history when the phone isn't present? Is this even possible? Would it be the same protocols as doing it from a phone/tablet?
#Ryan Tensmeyer, I think #Wayne Pieksarki's answer is now out-dated. I was able to create and run a stand-alone app that used BLE to connect to a third-party bluetooth device, namely, a wireless thermometer. I used a library called SweetBlue and tested the stand-alone app on an Android Wear Moto 360. It worked great -- no phone required!
It is not possible to connect 3rd party bluetooth devices to an Android Wear watch as you describe. You will need to pair your heart rate monitor with your phone, extract the data you want, and then use the Data Layer API to send the data to the wearable for display to the user.
EDIT: Android Wear devices now support the ability to pair with Bluetooth devices.
Does anyone know of a current Android cell phone that actually supports the Bluetooth SPP Profile? I have spent days online trying to find one, and nowhere do I see any cell phones that say they support the SPP profile. Furthermore, I have noticed all kinds of postings where people cant get their applications to work correctly because the phone they are using does not support the SPP profile, or it has been disabled on their phone. Am I missing something here? Before I commit to developing my Bluetooth application for Android, I want to make sure it can actually be done.
I am hoping that the answer is that we implement the SPP profile via the Bluetooth API, and therefore we can use RFCOMM on any Android OS level that supports it, i.e., 2.0 or above. Is this correct?
SPP is RFCOMM, from the docs:
The most common type of Bluetooth socket is RFCOMM, which is the type supported by the Android APIs. RFCOMM is a connection-oriented, streaming transport over Bluetooth. It is also known as the Serial Port Profile (SPP).
So yes, any device at API level 5 (2.0) or above will support BluetoothSocket and therefore SPP.
#GAZ This does not appear to be true. Take the Droid Incredible S, for example, running Android 2.3. Now install an app called Bluetooth Remote Control. The app displays a list of all BT devices it finds but remarkably does not find those that advertise only SPP. I can use that same app on my Nexus S and it finds the same devices that the Incredible misses. I can only assume that it is the carrier that disabled serial Bluetooth on their phones - as a way of preventing tethering.
Since I first posted this answer I have discovered the probable cause of the failure to discover some Bluetooth devices. It appears that when the major device class is BluetoothClass.Device.Major.MISC (0), many phones simply skip this device during discovery, although I can't imagine why. If anyone has thoughts on a workaround, I would love to hear them.
Turns out that there is a workaround for this bug (device class 0 being skipped). Find it here: http://zornsoftware.talsit.info/blog/pairing-spp-bluetooth-devices-with-android-phones.html
Does anyone know the UUID to connect an android 2.2 device to a WiiMote? The wiimote will not pair, as the wiimote does not require a PIN #.
Apologies for answer an old question, but to pair the Wiimote using legacy pairing, you reverse the bytes of the device address and use that as the pin.
As far as I know, you can only connect a Wiimote to a non-Wii device if you use a bluetooth stack/program that allows you to skip the PIN. This is possible a couple of different ways on laptops and such, but Android 2.2 requires the PIN for the first pairing.
However, depending on what kind of phone you have, you can try the WiimoteController app. It doesn't connect on HTC devices that are running the Sense UI, but if you have a Nexus One or you're running some kind of custom vanilla Android ROM on your phone, it should work.