【发布时间】:2019-08-15 15:46:32
【问题描述】:
如果我需要监控 UUID 的特定区域。
在一个区域中声明,但是当进入 didEnterRegion 时,我只得到 UUID 和 Major 和 Minor 为空,我是否需要做 didRangeBeaconsInRegion 来只找到定义的区域而不找到另一个不需要的区域?
我将区域定义如下:
Region region = new Region ("region", Identifier.parse ("UUID"), null, null);
另一个问题,图书馆是否按位置查找信标?
非常感谢, 问候
public void onBeaconServiceConnect() {
beaconManager.addMonitorNotifier(new MonitorNotifier() {
@Override
public void didEnterRegion(Region region) {
Log.i(TAG, " enter region");
try {
beaconManager.startRangingBeaconsInRegion(region);
Log.i(TAG, "region beacon" + region.getId1() + " " + region.getId2() + " " + region.getId3());
} catch (RemoteException e) {
e.printStackTrace();
}
}
@Override
public void didExitRegion(Region region) {
Log.i(TAG, "I no longer see an beacon");
try {
beaconManager.stopRangingBeaconsInRegion(region);
} catch (RemoteException e) {
e.printStackTrace();
}
}
@Override
public void didDetermineStateForRegion(int state, Region region) {
Log.i(TAG, "I have just switched from seeing/not seeing beacons: "+ state);
}
});
try {
beaconManager.startMonitoringBeaconsInRegion(new
Region("myMonitoringUniqueId", Identifier.parse("UUID"), null, null));
} catch (RemoteException e) {
}
}
【问题讨论】:
标签: android android-studio ibeacon beacon altbeacon