Bluetooth Low Energy Discovery on Android - android

It seem Bluetooth Low Energy (aka Bluetooth Smart) has no official support on Android, even version 4.2. Anyone know if the standard Android API can discovery BLE devices? (I don't need pairing just discovery would be good)

It is correct that Android took a switch from Bluez -> Broadcom Bluetooth. This switch was causing lots of problems for Android users. Missing BT classic profiles and Wifi v.s. BT coexistence (one probably reset the other since they are in the same chipset in most phones). iPhone and MAC computers suffer a lot from the same problem (BT v.s. Wifi).
The Broadcom Open Source Low Energy API was not included in 4.2.
HTC One X+ got slightly modified (?) Broadcom BLE API on top of Bluez in 4.1.x and it works reasonably good though I have to retry connection sometimes. The package name is htc not broadcom but sometimes Eclipse error messages tells that it is missing some broadcom references.
Also Samsung got a "secret" API for BT BLE with their own package name which can discover devices but seems to be not really robust (which may be why it is "secret")
Google have officially said that "BLE is the next big thing we will release". So maybe in Android 5.0? but hopefully before so Galaxy S2 (which have such a big marketshare and uses the same chipset as iPhone 4s) can get BLE support. (Just speculations and hopes from my side). If Android 5.0 get's BLE API's then Samsung Galaxy S3 should get it as Samsung has listed this as getting Android 5.0.
Only time or Google will tell... It's way overtime getting this old Nokia Research Center technology out in other than Meego and iOS devices.

EDIT 2: Seems like my lucky day is today ;) : new link
EDIT: Seems like today is your lucky day: Open Source API
I guess this answer is not adequate, but it is: on some devices yes, on others no.
A company I worked for did some testing with it and they could pair in on a Galaxy S3 while my HTC One S didn't even discover it.
So if a manufacturer has implemented this feature it will work, but most times it won't.
Some discussion about this: Texas Instruments

Sounds like a standard api will be coming to Android api 18 http://www.androidpolice.com/2013/05/15/bluetooth-low-energy-and-avrcp-1-3-coming-to-android-with-api-level-18/

Devices with the relevant hardware will work with Android 4.3.x support. I just put a Galaxy S2 GT-I9100 to 4.3.1 Slimbean and can now pair it with a Bluetooth 4.0 LE/Smart heart rate monitor. This, in spite of the stock hardware only ever supporting BT 3.0+, according to Samsung.

Related

HTC BLE problems and kontakt.io beacons api

I wrote and app using kontakt.io api and examples for beacons.
This app correctly work on Sony Xperia SP, but when I use different models of HTC smartphones (like HTC Desire 820) this app work really slowly (active time for scanning is 3 seconds, for passive scanning - 2 seconds).
If I use Bluetooth scanning on the HTC (via settings of smartphone) - I had same problems. Very slow work (slow scanning).
Can somebody explain, why is so? Maybe this problem is only on HTC?
Disclaimer: I work for Kontakt.io, although not as an Android developer
Unfortunately the biggest strength of Android, its openness and variety, is IMHO also a source of the weakness that you see right now. Different manufacturers use different Bluetooth chipsets, antennas, etc. in their devices. All of the possible combinations usually work in typical Bluetooth use cases, like connecting to Bluetooth speakers, keyboards, etc., but some of them fail when something more is required (e.g. scanning beacons).
In my experience latest Samsung flagships are pretty reliable, but e.g. OnePlus phones have a lot of problems with beacons. Similarly, Nexus 5 is one of the best Android phones when it comes to working with beacons, but Nexus 5X really struggles with detecting them. You've mentioned Sony Xperia SP, that it works OK, but we had Xperia Z (don't remember the exact model, sorry) and it was horrible. Apparently your HTC falls into the Bad BLE category :-(
This is a prioprietary software, so you should ask Kontakt SDK developer.
From my side I would suggest a following thing: check Android version system both devices operate on. BLE Android API was introduced in Android 4.3 and got huge refactor in Android 5.0. So this maybe the case of slow scanning.
Also take into consideration, that BLE devices do not broadcast their presence all the time, as one of their purposes is very low battery usage.

Android: Limit of simultaneous BLE connections

we are developing an Android app which can connect to multiple heart rate sensors simultaneoulsy via Bluetooth Low Energy.
We have an implementation which is working quite well, so the code is not the problem.
What drives us crazy is the limitation of parallel BLE-connections which seems to be different from device to device.
We have a few test devices here: Motorola MotoE and MotoG, a Samsung Galaxy Tab A and an HTC Nexus 9. All of them are running Android 5 or 6, original vendor versions. None of them is able to connect to more than 7 BLE HR sensors simultaneously.
Then I have tested with my private Samsung Galaxy S4, which is rooted and has Cyanogen CM12 installed. With this device I can easily connect to 12 HR sensors simultaneously which is the number we want to achieve with our app.
I have tested this both with our own app implementation and with the Nordic Semiconductor nRF Master Control Panel which I think is a pretty good generic BLE app: https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp&hl=de
When I try to connect the app to a 7th BLE sensor on any of our devices, the ADB output prints the following error message:
E/BluetoothLeBasicConn: Connection state changing error: 133
I did some pretty intensive googling about that whole problem, but most of the results I've found were quite old. Some people said, that the limitation came from the Bluetooth Chipset itself, others said it was a software limitation through Android.
Could you help me to find out, where the limitation is coming from?
If it is the chipset, then I would like to know, which devices we should use for supporting as many parallel connections as possible. Sadly it is very hard to find out which Bluetooth chipset is built in the different devices. Hardly any of the hardware specs I found tell anything about this.
If the limitation comes from software side, can we change it somehow without rooting phones or install modded OS?
Thank you very much!
In case that you are still interested in it. The limit comes from
BTA_GATTC_CONN_MAX (hardcoded in android)
Which is set to:
4 on Android 4.3 and
7 on Android 4.4
There is by the way also a limit on the amount of characteristics for which you can activate notifications. (BTA_GATTC_NOTIF_REG_MAX)
which is:
4 on Android 4.3,
7 on Android 4.4 and
15 on Android 5.0

Bluetooth connection with Android

In my App I need to connect a smartphone with an 4.0 low power Bluetooth-module. Then the module sends frequenly data to the phone.
Do you know some good tutorials for programming Bluetooth connection
with Android?
Can you give me some links where the basics of Bluetooth are
explained? (german if possible)
How can I test it? (I have to programm the Bluetooth device too
and it's not finished jet)
Google havn't understood that sometimes they have to actually create and DRIVE something themselves, not just piggybacking on open source stuff and marketing it as their own.
Unfortunately there are no standardised BT 4.0. Low Energy API's for Android yet. Maybe Google just decided to only go for NFC for Google Wallet or something and then let BLE die. (We really need BOTH!)
Broadcom tried to make an open source API but somehow (maybe Broadcom wanted money from them?) no phones included the ".so" file in their Android build so this API is useless.
TI and Motorola made another API for the RAZR series running on old Android 2.3.3 or something. This actually works but Motorola removed the documentation and source-code from their site.
HTC ONE X+ and newer HTC phones will support a new API "soon" with special HTC libraries according to HTC. (At least it seems they are doing something)
Samsung Galaxy S3 have some "secret" API's that some people can use for discovering devices, scanning services and characteristics (there is an app in google play "semilink Bluetooth Smart Scanner" which on the Galaxy S3 can do those things).
Google asked Broadcom to make a replacement for Bluez in Android 4.2. Unfortunately this release broke a lot of functionality and peripheral compatibility. Maybe because one or more of Wifi/GPS/Bluetooth Classic/Bluetooth Low Energy shares the same HW resources but the drivers doesn't handle that very well. Lot's of people got problems with the newest Android Bluetooth functionality.
So I would expect Broadcom to focus on fixing the mess and THEN with Google move on to add Bluetooth 4.0. Low Energy. Google have said "Low Energy is the next BIG thing we will integrate". At least 1 year too late.
Personally I had to buy an iPhone4S and iPad retina to get platforms which supports low energy. With those we could finish the BLE peripheral sw and get the protocols working. Now we are waiting for Google and Broadcom to clean up the mess. Hopefully with some backwards compatibility so all the old phones with BT4.0. capable chipsets will also open up to the wonderful world of coincell battery driven peripherals ;-) (got to dream).
In reality we must wait for HTC to release their APIs and for Google to choose/drive the standard API.
Windows Phone 8 was supposed to get BLE but it has been postponed for an update. (Lumia 920 is certified but without API's (AGAIN!!) we developers are helpless)
There are nice GATT API's for Windows 8 as well as for MAC "OS"x.
You really should invest in the TI BLE development kit which costs like $50-$100 for a dongle which can be used for BLE sniffing. It comes SOOO handy when you develop your BLE Peripheral SW.

BTLE (Bluetooth Low energy) development kit - must have proximity profile

Can anyone point me towards a tried and tested development kit (board) for Bluetooth Low Energy?
I am especially interested in the proximity profile, and compatibility with smartphone (especially iPhones and Android devices - but also any other that would have BTLE).
Also, can you tell me which smartphones would support the proximity profile?
If you are looking for API support for BT LE features then there is very little at the moment. For example, Android at API16 does not support. It is all rather disappointing so far. In many instances the HW supports it but the middleware / upper layers do not. There is SOME support on iOS (with Iphone4s) and with certain Moto phones (need the SDK add on) but it is limited.
iOS is probably your best bet (who'd have thought that).
Personally I am looking to use the GAP and GATT interface on Android (ICS/JB), which is mandatory for a BT4.0 listed device (such as the BT ICs in high end smartphones) but GAP does not seem to be exposed.
Oh, and if you need a dev kit (for SW dev then this link might help > http://blog.bluetooth-smart.com/2011/10/05/bluetooth-low-energy-development-kits-2/)
The Bluegiga DKBLE112 Development Board (out of the box) can communicate with the iPhone 4S on IOS 6. The IOS code tutorials by http://olesitune.mine.nu/blelogg/?page_id=78 and http://olesitune.mine.nu/blelogg/?page_id=180 will discover the DKBLE112, the built-in thermometer service, and the associated characteristics. The code displays the BLE information on the iPhone and in the Xcode Console if the iPhone is tethered through USB. The DKBLE112 is expensive (nearly $400) but it does include many capabilities that I have not yet explored.
I note that tod list devices that have BT4.0 functionality. Of course that does not guarantee that APIs will be exposed in the SDK. If you stick with an already implemented profile then you may be ok but as I said, you certainly will not find that in the Android API16. SO, custom implementations.
One of the nice things with BT LE is that profiles are relatively "light" and hence, you can pretty easily make your own...but if the phone side API does not give access to the lower level (only talking GAP and GATT here) then not much use..
The guys who produce the tod seem to have done pretty well with a BLE device that functions as a proximity sensor.
They've managed to get their device working on the following phones:
iPhone 4s, Droid Razr and Razr Maxx, Samsung Galaxy S3, HTC One S, X, V, LG Optimus LTE2, Droid 4, Droid Incredible 4G LTE, HTC EVO 4g LTE, HTC Desire C, Sony Xperia GX, Sony Xperia SX, ASUS PadFone
So it is possible. My recommendation for a dev kit is the Bluegiga BLE112 with a CC Debugger from Texas Instruments. Your options for programming are either the $4,000 IAR compiler, the proprietary Bluegiga API "BGScript" (if you don't have access to IAR), or use an external microcontroller with the compiler of your choice.
I am using a TI ez430-rf256x development kit with "IAR Embedded Workbench for MSP430 v5.51.5". When TI 1st released the ez430, they were using a crappy stack that was buggy and just wasn't capable. They have now switched to a Bluetopia based stack and it is great! It comes with a LOT of samples, supports ALL profiles (including all the new low energy profiles), and is easy to use. I believe the Bluetopia stack also supports I have it talking to my Galaxy Nexus over classic bluetooth, but unfortunately, as of Android 4.2.2, there is still no support for Bluetooth low energy (which the ez430 does support.) It appears that Google may address this issue in Android 4.2.3. In my opinion, there is no reason to use something like Bluegiga, as you will pay more in licensing costs to them, than you will spend on a compiler like IAR. This is a link to an explanation of the new stack that TI is using: http://www.stonestreetone.com/bluetopiaLE.cfm
I realize this is an old question and in disclosure I am a developer on this project: Anaren Atmosphere.
Anaren has produced a Bluetooth Smart Multi-Sensor Development Board with the A27037 module based on the Broadcom BCM27037 that is compatible with the Wiced SDK. It also features an online development environment that is a GUI/IDE that allows you to both program the module and create associated iOS and android applications to communicate with it.
The development kit is available from various distributors and the development tool is free to use.

Bluetooth 4.0 / Smart / Low energy on Samsung Galaxy S3

I'm trying to develop a bluetooth 4.0 app for S3. The problem is, the phone behaves like it doesn't even have bluetooth 4.0. It doesn't discover 4.0 devices, and isn't discoverable with 4.0 devices. I tried both in the settings of the phone and in an app, using the Broadcom-ble API. The Broadcom API doesn't have any extra functionality for finding/discovering 4.0 devices, rather it uses the regular BluetoothAdapter functionality and claims that it will be augmented in 4.0 phones to also discover 4.0 devices.
Has anybody tried using bluetooth 4.0 on the S3? Has anyone succeeded in using the Broadcom API?
Thanks in advance.
This is now a confirmed bug, that will be fixed "in future releases".
See this forum thread at Samsung.
A beta for Samsung BLE SDK has been released here. I am going to study this SDK and hopefully it solves some of my problems.
It has been reported by Andrew Dodd, a senior XDA developer, that the Galaxy S3 doesn't actually support Bluetooth Low Energy
The Galaxy S3 has been marketed as Bluetooth 4.0 Low Energy (aka Bluetooth Smart) since its release - but it is not actually BTLE capable -http://developer.samsung.com/forum/board/thread/view.do?boardName=GeneralB&messageId=157757 - Samsung is STILL advertising the device as BTLE capable when it is NOT, despite the fact that they have been aware of this false advertising for months.
Samsung have a page at:
http://developer.samsung.com/ble
where you can download a Bluetooth LE SDK and sample code (registration is required, but otherwise it's automatic).
For what it's worth, there's an HTC page at:
http://www.htcdev.com/devcenter/opensense-sdk/partner-apis/bluetooth-low-energy/
where you can request access to their 'Partner APIs'. This needs license agreements to be signed (which for me means lots of lawyering) so I've not actually got code from them yet..
Ian
Refer this link
http://e2e.ti.com/support/low_power_rf/f/538/p/240097/879328.aspx
http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/538/8880.S3-BLE.zip,
attachment package can run on Samsung S3, now it limit with discover BLE devices and pairing. Some recent days, i try to find out how to send/receive data. But still not any luck.
I hope it can help.
Update your phone to Jelly Bean, then download nRf Utility from the Play Store, it can scan BLE devices around you!

Categories

Resources