How to use Broadcom BLE SDK (SMART 4.0) in Android 4.X

21,543

Solution 1

The problem is that if your phone doesn't have the .so file installed, this isn't going to help.

And your device will only (as of this writing) have the .so file if Broadcom has blessed the device.

For example, the latest official build (4.0.4) for the reasonably-new Samsung Galaxy Nexus does not.

For those that don't know, there are two different (incompatible) APIs for LOW-ENERGY Bluetooth (BtLE, now apparently called BT Smart). One is from Broadcom, and the other is from Motorola. Unsurprisingly, each only works on a phone that has that vendor's chips in it.

This is a terrible, terrible situation, and Google REALLY needs to get moving on a solution or Android will become totally irrelevant in a little industry known as HEALTHCARE!!!!!

Solution 2

The HTC One X and One S use a Qualcomm Bluetooth chip, not Broadcom. Therefore the Broadcom SDK would not be expected to work. There is an HTC BLE SDK that works with the HTC One X+, Droid DNA, and HTC One that you can sign up for the HTC BLE SDK here:
http://www.htcdev.com/devcenter/opensense-sdk/partner-apis/bluetooth-low-energy/

Solution 3

Confirming BroadCom BLE stack works on HTC 1X+ and cooperates with standard TI KeyFob Demo.

Seems like I'm making a dumb post, but I thought someone might be encouraged to keep going by an unequivocal statement of at least a tiny success.

BleFindMeClient really does work on the HTC 1X+ in conjunction with the TI CC2540-mini Keyfob aka KeyFobDemo in the TI distro.

I've never written an Andoid app., or code for the TI keyfob, so it took me a frustratingly long while to figure out how all the tools worked and how to configure them, but there was no real magic. For me, some of the other Android demos don't compile out the gate without some code tweaks, but that could just be my inexperience.

http://youtu.be/cqWpjU7gJ2Q

On the other issue regarding getDeviceType(), here is a code fragment that works perfectly every time on the HTC 1x+. Hope this helps too.

BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
if ( BleAdapter.getDeviceType(device) == BleAdapter.DEVICE_TYPE_BLE ) {
    ...
}

Solution 4

Someone find the solution here.

The three steps to do are :

  1. Do not include in manifest file.

  2. In project PropertiesJava Build PathLibrariesAdd external jar, add broadcom ble jar.

  3. In project PropertiesJava Build PathOrder and Export, check the included jar in step 2.

Finally, the Broadcom samples projects run, but crash after few seconds due to an unknown virtual method not implemented on HTC (.getDeviceType(), ...)!

Solution 5

It seems that something might be missing on the HTC phones as well. This error means that there is probably a layer of software missing (or malfunctioning) between the BLE hardware and the API. As for today I have only seen BLE kind of working on an the Motorola Razr but it seems to be limited to the heart rate profile (and it does not use the Broadcom API).

Share:
21,543
sdespont
Author by

sdespont

SOreadytohelp

Updated on September 19, 2020

Comments

  • sdespont
    sdespont almost 4 years

    I am trying to develop a BLE bluetooth (SMART) application for Android.

    I managed to download the Broadcom BLE SDK, install through the Android SDK Manager as explained on the web site and download the projects examples.

    When I tried to push one of the examples into my tests phones (HTC One S, HTC One X both with Bluetooth BLE feature), I am facing the following issue:

    INSTALL_FAILED_MISSING_SHARED_LIBRARY
    

    Is there any possibility to include the broadcom library described in the AndroidManifest.xml file ? <uses-library android:name="com.broadcom.bt.le" android:required="true"/>

    Is someone managed to test the broadcom projects examples? And on which phone?

    According to this post, a bug has been discovered on Samsung Galaxy S3, but I didn't find any information about HTC products.


    UPDATE : What a great news!!!

    Last Android version 4.3 (Jelly Bean) now support low-energy Bluetooth Smart accessories.

    http://www.android.com/about/jelly-bean/

    https://developer.bluetooth.org/Pages/Bluetooth-Android-Developers.aspx

    Not sure that every phones will have an update (even the last HTC One M7 for example) but next phones will certainly embed this major release.