**目前已知设备概述:Nexus 6,Nexus 9,Moto E 4G LTE,LG G4,Galaxy S6,三星Galaxy S5(型号SM-G900M),Nexus 5X,索尼Xperia Z5 Compact,三星Galaxy Tab S2**
**另见https://altbeacon.github.io/android-beacon-library/beacon-transmitter-devices.html**
Android 5版本的新功能之一是支持蓝牙低功耗外设模式.虽然它被提升为独立于所使用的设备而工作,但它似乎依赖于芯片组(参见BluetoothAdapter.java中的isMultiAdvertisementSupported()函数).
它适用于Nexus 5,但不适用于Nexus 7(称为BLE外设支持Android-L示例中的错误,但由于其芯片组可能无法正常工作?).此外,https://code.google.com/p/android-developer-preview/issues/detail?id = 589也未给出结论性陈述.
我担心的是,由于许多旧设备预计将获得Android 5,只有最新的平板电脑(以及相对较新的手机)将支持BLE外设模式.对于依赖此新Android 5功能的应用的最终用户而言,这可能不明确.
对我而言,目前尚不清楚最终将获得Android 5的哪些芯片组/设备将支持BLE外设模式.谁可以给我任何见解?哪些芯片组支持BLE外设模式?更具体地说,由于我们的许多客户都拥有Nexus 7(2013),Nexus 7是否会得到支持?
编辑19-2-2015: 自2014年12月起,Nexus 5不再支持,只有Nexus 6和9似乎支持BLE外围模式/广告.希望支持这一功能的设备数量在不久的将来会大幅增加.
有关详细信息和讨论,请访问:https: //code.google.com/p/android-developer-preview/issues/detail?id = 1570
编辑6-3-2015:添加了快速参考概述
编辑17-2-2016:添加了一些我自己检查但不在任何其他列表中的设备
我试图在NEXUS 9中做广告并得到ADVERTISE_FAILED_DATA_TOO_LARGE的错误.在成功通告后添加服务时,它工作得非常好但是如果我通过"广告数据"构建器添加服务以便其他设备可以在扫描时进行过滤,则会收到错误代码1,即ADVERTISE_FAILED_DATA_TOO_LARGE
a)工作准则
public void startAdvertisingService() {
AdvertiseSettings settings = new AdvertiseSettings.Builder()
.setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH)
.setTimeout(0)
.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY)
.build();
AdvertiseData.Builder advertiseData = new AdvertiseData.Builder();
advertiseData.setIncludeDeviceName(true);
BluetoothLeAdvertiser myBluetoothLeAdvertiser = btAdapter.getBluetoothLeAdvertiser();
myBluetoothLeAdvertiser.stopAdvertising(mAdvertiseCallback);
myBluetoothLeAdvertiser.startAdvertising(settings, advertiseData.build(),mAdvertiseCallback);
}
private AdvertiseCallback mAdvertiseCallback = new AdvertiseCallback() {
@Override
public void onStartSuccess(AdvertiseSettings settingsInEffect) {
super.onStartSuccess(settingsInEffect);
BLEBroadcast();
}
@Override
public void onStartFailure(int errorCode) {
String description = "";
if (errorCode == AdvertiseCallback.ADVERTISE_FAILED_FEATURE_UNSUPPORTED)
description = "ADVERTISE_FAILED_FEATURE_UNSUPPORTED";
else if (errorCode == AdvertiseCallback.ADVERTISE_FAILED_TOO_MANY_ADVERTISERS)
description = "ADVERTISE_FAILED_TOO_MANY_ADVERTISERS";
else if (errorCode …Run Code Online (Sandbox Code Playgroud) peripherals android bluetooth bluetooth-lowenergy cbperipheral