Search code examples
androidbluetoothmodeenergy

BLE Advertisement mode in Android 21 API


I'm working with the Moto G 2013 and the Nexus 5 and need to use them as BLE (Bluetooth Low Energy) advertisers. This functionality was added with Android API 21 and both devices are running Android 5 Lollipop.

Thing is, I believe the hardware supports BLE advertising but I've read around and it seems Google dropped support for BLE advertising in the Nexus 5, but I can't find any info on the Moto G.

One is supposed to call this method to check if BLE advertisement is supported, which I am doing like so:

    BluetoothManager btManager = (BluetoothManager) getSystemService(BLUETOOTH_SERVICE);
    BluetoothAdapter btAdapter = btManager.getAdapter();

     if(btAdapter.isMultipleAdvertisementSupported()){
            //Do Stuff
        }
        else{
            //Do other stuff
        }

In both the Moto G and the Nexus 5 the method returns false.

Does anyone have any way around this (or extra info)?


Solution

  • An update just to close this off:

    This was only available in two devices with SDK21: Nexus 6 and Nexus 9. Other devices didn't work/weren't supported.

    I ended up using a Nexus 9.

    From here (original link is dead):

    We introduced BLE peripheral mode in Android 5.0 Lollipop. Nexus 6 and Nexus 9 are the first two production Nexus devices that support BLE peripheral mode. Due to hardware chipset dependency, older Nexus devices (4/5/7) will not have access to the feature on Lollipop.