App调用SDK扫描接口,能调用成功,但扫描设备空,同台使用brightbeacon能扫描设备
调用方法:
BRTBeaconManagerListener manager_listener = new BRTBeaconManagerListener() {
@Override
public void onUpdateBeacon(ArrayList<BRTBeacon> arrayList) {
System.out.println("manager update: " + arrayList.size());
if(arrayList.size() > 0)
System.out.println("manager update: " + arrayList.get(arrayList.size() - 1)
.getMinor() + " " + arrayList.get(arrayList.size() - 1).getRssi());
}
@Override
public void onNewBeacon(BRTBeacon brtBeacon) {
System.out.println("manager new: " + brtBeacon.getMinor() + " " + brtBeacon
.getRssi());
}
@Override
public void onGoneBeacon(BRTBeacon brtBeacon) {
}
@Override
public void onError(BRTThrowable brtThrowable) {
}
};
BRTBeaconManager brt_manager = BRTBeaconManager.getInstance(context);
brt_manager.startService();
brt_manager.setBRTBeaconManagerListener(manager_listener);
brt_manager.startRanging();
一直输出
manager update: 0
建议在检查一下配置文件中是否有配置service,同时建议测试在手机上测试
2019-06-11register必须在Application中吗,在App运行中调用扫描的时候注册可以吗
com.brtbeacon.sdk.BleService 服务配置了,使用是在手机设备上进行的
2019-06-11