The Android 5.0.X will only allow you to use the new API for BLE. This new API comes with a new feature, which you mentioned in your question: The possibility of advertising, from your own Android device, using it in Peripheral mode. However, the disadvantaged of this new feature is that it is hardware dependent. For example, before you start any BLE you need to:
First: Check to see if the BLE is supported, which you can do by adding this line in your manifest: <uses-feature android:name="android.hardware.bluetooth_le" android:required:"true"/>
Second: You need to check if your chipset has support for it, using the following methods:
bluetoothAdapter.isMultipleAdvertisementSupported();
bluetoothAdapter.isOffloadedFilteringSupported();
bluetoothAdapter.isOffloadedScanBatchingSupported();
Also notice that for both of the above methods, the API documentation clearly states that:
"Return true if the multi advertisement is supported by the chipset"
"true if chipset supports on-chip filtering"
"true if chipset supports on-chip scan batching"
That being said, it brings us to the question:
"Which hardware devices are going to support this feature ?"
Well, the answer to that is a little bit more complicated since this is not a mandatory feature for the bluetooth hardware/protocol and it will probably vary from manufacture to manufacture. But for now, the only currently devices that officially are supporting the technology, without major issues, are the Nexus 6 and Nexus 9, since their hardware already comes with the support. The best that you can do it, is not rely solely on the technology for now and try to explore other possible solutions, if any.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…