简体   繁体   中英

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)?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM