Bluetooth Low Energy API for Jelly Bean 4.2

Linard Arquint picture Linard Arquint · Dec 2, 2013 · Viewed 11.6k times · Source

After hours of research on the BLE topic and android, the only thing that I've found is a big mess. Developing an app for iOS, which uses BLE was quite simple - one framework and a few documentations. Now, I have to write an app for android Jelly Bean 4.2.2 (the app can work on just one device, which ships currently only with 4.2.2) which has to discover and connect to BLE devices.

I found out, that until 4.1 the bluetooth stack on android is called BlueZ, but with 4.2 Google changed to a stack from Broadcom. I know that with 4.3 there's an official and built in support for Bluetooth Low Energy in android, but the app has to run under 4.2.2.

After a lot of research, I haven't found any documentation about the Broadcom stack. Can someone point me to a link (which is still working and doesn't end in a 303 error)? Does the stack has BLE support and does someone know a tutorial on that or could provide a few lines of sample code?

Thank you very much for any inputs! I'm really lost in that mess

Linard

Answer

Linard Arquint picture Linard Arquint · Sep 22, 2014

After 3/4 year and many views I wanna answer the question by myself:

We talk with the chinese manufacturer but they couldn't give us a release date for JB 4.3 (at the moment it looks like that a hardware upgrade is necessary 😂). Therefore we searched for another solution and we found one: BlueKitchen GmbH (http://bluekitchen-gmbh.com), a small company which has developed BTStack, an open source Bluetooth stack for jailbroken iOS devices and embedded systems, has modified their existing stack to make it compatible with our specific Android device. Involved in the solution is rooting the device, replacing the original Bluetooth stack with our custom one, unrooting the device and then shipping it to our customers. Because the stack runs as a system service independent from the application, the application doesn't need any root rights and can be easily installed and updated via the Google Play Store or the ADB console without rooting. The application talks with the stack through a socket connection and therefore can use plain Java code. Inside the application one has to distinguish between the custom stack and a device running JB 4.3+ with the native BLE stack. But because the BLE protocol dictates the APIs, everything is very similar.

Feel free to ask me about the implementation of that stack inside an application and contact BlueKitchen if you are interested in that stack version for the iSafe Innovation 2.0 or Ruggear RG220 device or if you want a stack for another Android device (with a BLE chip)

I hope you can find a solution too

Linard