I know, transferring is restricted and i do not need that. Also, i'm aware of BLE capabilities. However, ~35% of android devices out there do not support peripheral mode.
If someone ever tried this, could you tell me: does ios BT api allow to discover android devices? I need only mac (or whatever it called) address from android device, nothing else.
iOS (CoreBluetooth) can discover any Android BLE device as long as it supports the Peripheral role. If your Android device does not support Peripheral role then the iOS device needs to be the Peripheral in your connection scenario.
If you want to use Bluetooth Classic, that is a completely different story because in order to use Bluetooth Classic on iOS you need to be member of Apple's MFI program that comes with extra fees and an NDA.
Related
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.
I want to know if we can detect android phones as well with BLE Scan. I am trying to develop an android app which can scan nearby Bluetooth Android devices.
I checked both android devices are compatible with BLE with this app: https://play.google.com/store/apps/details?id=com.myan.michaelyanyoga.bluetoothchecker
Note: I am using this code to develop my scanner app: https://github.com/kaviles/BLE_Tutorials. I am able to see my laptop Bluetooth on this list but not other android phones(which supports BLE).
To detect Android phones using BLE, the other device needs to:-
Have Bluetooth turned on.
Be advertising
Unfortunately, most devices are not doing this by default, which means you may not be able to use BLE for your intended purposes. You can test this by doing the following:-
Download the nRF Connect Android app.
Go to ADVERTISER from the top menu.
Toggle the "Test" advertiser.
After this you should begin to see your Android device via Bluetooth.
I hope this helps.
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.
My question is on Android capability, whether or not we can use the Android smartphone as a BLE peripheral device. Base on my efforts, the connection will be dropped very quickly and we can't establish a persistent connection in this mode. We are struggling with this issue for two weeks. While Android documentation is mentioning that is possible and Android devices are able to play the peripheral role but this is not happening in reality.
This blog post from radius networks discusses how Android devices can not yet be used as iBeacons (AKA: BLE peripheral mode) even if the device's hardware supports BLE, because Android has no APIs for BLE peripheral mode.
NOTE: BLE means Bluetooth Low Energy
After reading this section, I am gonna suggest something stupid
Because their SDK only supports the central role, “advertising” a
service as a central server means sitting their quietly, only
revealing (or “advertising”) its service characteristics to another
device in peripheral mode after a connection is already established.
This connection establishment requires another device to do the actual
radio advertising first. Samsung’s SDK isn’t going to do it.
Is it possible to trick the device in central mode (the Samsung phone) into thinking another device in peripheral mode has established a connection to it and then get the central mode to "advertise". Can you trick the phone by faking the connection in software?
Probably a stupid idea, probably it's possible to trick the device in central mode, but the "advertisement" is not the BLE peripheral mode advertisement and would not resemble an iBeacon in peripheral mode.
I very much need BLE peripheral mode support from Android and for the moment I would be ok with hacking something, in the hopes that Android is going to eventually support this feature-set, which BTW is already a feature request
I don't think this technique will work, even if it is possible to "trick" Android into thinking it has a connection to another BLE device. Although this question is about the Samsung BLE SDK, I think the same answer applies to the dedicated Android BLE APIs (android.bluetooth.BluetoothAdapter) that shipped starting with Android 4.3.
Let's put aside the tricking part for a minute -- even if Android's actually does have a connection to another BLE device, can you make it advertise? If by "advertising" you mean revealing its services to the other device, the answer is yes. But this radio transmission is over a private channel between the two devices, and could not be picked up by a BLE scan in the same way that iBeacon advertisements are. It really isn't an advertisement at all -- which is why I said in the blog post that the Samsung documentation is misleading. So if you can't do this with a real connection, then tricking a connection won't work either.
My understanding of bluetooth stacks is limited, but I think that the actual radio broadcast advertisements that scans can pick up are controlled by the hardware BLE chipset, which means you have to have access to the parts of the bluetooth stack that tell the hardware to make this happen. I don't think there is anything in Samsung BLE SDK or the Android SDK that intentionally allows this.
An alternative may be to make direct JNI calls to the BlueDroid stack. I'm not sure if Android permissions allow this, or if advertising is even implemented in the BlueDroid stack.
UPDATE: Transmitting as a pheripheral now possible in Android 4.4.3 and Android L. See here.