Any simulator available to test BLE(Bluetooth Lowe energy) mobile applications instead of testing with real BLE device?
Yes. You can check BLE Peripheral Simulator available in Play Store.
I have built an iOS app that uses corebluetooth, and an android app that starts avertisement via GATT server.
So Android devices only discover other androids and iOS devices.
And iOS devices discovers other iOS' only.
The question is how to advertise data from android so iOS devices can discover it, or is there any way for iOS device to scan regular bluetooth devices except for MFi program?
if you had any experience with connecting these two OS via bluetooth, please let me know the ways on how to do it.
My app required to connect 9 Ble devices concurrently.
In this article and any other resource it write that android 4.4+ can connect only to 7 devices.
Is there anything new in M or N versions?
Thanks.
The number of connections is limited by the constants MAX_L2CAP_LINKS and GATT_MAX_PHY_CHANNEL which is currently (still) set to 7.
If you try to connect the 8th device with autoConnect = true, the stack will hang and fail to connect again until you restart Bluetooth due to a bug introduced in Android M. If you use autoConnect = false to connect an 8th device you will immediately get an onConnectionStateChange callback with newState = disconnected and no attempt to connect will be made.
I don't know why these constants are so low. Often the hardware itself can do more than 7. For example, Nexus 6P can do 15 if you compile AOSP yourself and change the constants.
Samsung seems to have noticed the issue and increased the constants on some of their devices. For example, Samsung Galaxy Tab A 10.1 can handle 15 BLE connections without modifications.
It seems that those constants are global limits, and not per app. I am linking to the source of the BT stack in Android. I wonder why those constants are as they are... seem random.
#define GATT_MAX_PHY_CHANNEL 7
https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/include/bt_target.h#1428
#define BTA_GATTC_CONN_MAX GATT_MAX_PHY_CHANNEL
https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/bta/gatt/bta_gattc_int.h#89
tBTA_GATTC_CONN conn_track[BTA_GATTC_CONN_MAX];
https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/master/bta/gatt/bta_gattc_int.h#424
NOTE
This is the official Android code. Up until Android 7.2 the vendors used to change that implementation a lot. The theory in Android 8 and above is that vendors should not modify it (not enough Android 8 devices on the field to see how this works in practice... at least at time of writing this reply).
I am developing an Android app which can broadcast advertisements using Bluetooth Low Energy APIs(Implemented in Android 5.0 with Nexus 6 & Nexus 9). I am putting my Nexus 9 in peripheral mode & it is broadcasting advertisements.
My question here is:
"Can every other android device with OS having Android 4.3 or greater receive advertisements without installing any third-party apps?"
I'm planning to develop Android app for peripheral mode only, but not for central mode for client devices.
Android 4.3 to 4.4 - Central mode(Device can receive advertisements)
Android 5.0 - Device can work in both central & peripheral mode.(can broadcast as well as receive advertisements).
Is it possible in any version of Android?
The answer is NO. There is no system tools / stock app that receive BLE advertisement (and display it out). You have to make it your own / use the existing third party app to achieve that.
**Overview of devices known so far:
Nexus 6,
Nexus 9,
Moto E 4G LTE,
LG G4,
Galaxy S6,
Samsung Galaxy S5 (model SM-G900M),
Nexus 5X,
Sony Xperia Z5 Compact,
Samsung Galaxy Tab S2 **
** Also see https://altbeacon.github.io/android-beacon-library/beacon-transmitter-devices.html **
One of the new features of the Android 5 release is support for Bluetooth Low Energy peripheral mode. While it is promoted to work independent of the used device, it seems to be chipset dependent (see the isMultiAdvertisementSupported() function in BluetoothAdapter.java).
It is working for the Nexus 5, but not for the Nexus 7 (called a bug in BLE peripheral support Android-L example, but it might never work because of its chipset?). Also https://code.google.com/p/android-developer-preview/issues/detail?id=589 does not give conclusive statements.
My concern is that, as many older devices are expected to get Android 5, only the newest tablets (and relatively new phones) will support BLE peripheral mode. This might be unclear to the end-user of apps relying on this new Android 5 feature.
For me it is very unclear which chipsets/devices, that will eventually get Android 5, will support the BLE peripheral mode. Anyone who can give me any insights on this? Which chipsets will support the BLE peripheral mode? More specifically, as many of our customers have a Nexus 7 (2013), will the Nexus 7 ever get supported?
Edit 19-2-2015:
Since December 2014 it is not supported anymore for the Nexus 5, only Nexus 6 and 9 seem to have support for BLE Peripheral Mode/ Advertising. Hope the number of devices supporting this will significantly increase in the near future.
More information and discussion here:
https://code.google.com/p/android-developer-preview/issues/detail?id=1570
Edit 6-3-2015: Added overview for quick reference
Edit 17-2-2016: Added some devices that I've checked myself but were not in any of the other lists
The Android 5.0.X will only allow you to use the new API for BLE. This new API comes with a new feature, which you mentioned in your question: The possibility of advertising, from your own Android device, using it in Peripheral mode. However, the disadvantaged of this new feature is that it is hardware dependent. For example, before you start any BLE you need to:
First: Check to see if the BLE is supported, which you can do by adding this line in your manifest: <uses-feature android:name="android.hardware.bluetooth_le" android:required:"true"/>
Second: You need to check if your chipset has support for it, using the following methods:
bluetoothAdapter.isMultipleAdvertisementSupported();
bluetoothAdapter.isOffloadedFilteringSupported();
bluetoothAdapter.isOffloadedScanBatchingSupported();
Also notice that for both of the above methods, the API documentation clearly states that:
"Return true if the multi advertisement is supported by the chipset"
"true if chipset supports on-chip filtering"
"true if chipset supports on-chip scan batching"
That being said, it brings us to the question:
"Which hardware devices are going to support this feature ?"
Well, the answer to that is a little bit more complicated since this is not a mandatory feature for the bluetooth hardware/protocol and it will probably vary from manufacture to manufacture. But for now, the only currently devices that officially are supporting the technology, without major issues, are the Nexus 6 and Nexus 9, since their hardware already comes with the support. The best that you can do it, is not rely solely on the technology for now and try to explore other possible solutions, if any.