Recently I started playing with a few Kontakt beacons and my Android phone (LG L30).
I added a default region to detect all beacons:
private static final Region ALL_BEACONS_REGION = Region.EVERYWHERE;
And I initialized a new monitoringListener. The relevant code:
@Override
public void onBeaconsUpdated(Region region, List<BeaconDevice> list) {
List<BeaconDevice> beacons = new ArrayList<BeaconDevice>();
Iterator i = list.iterator();
while (i.hasNext()){
BeaconDevice beacon = (BeaconDevice)i.next();
if(beacon.getUniqueId() != null) {
beacons.add(beacon);
}
}
}
While debugging I noticed, that sometimes the uniqueId is null. That's why I am checking if it is null, but I still find it very strange. Is that common or is there a mistake in my code? And how can I uniquely identify a beacon if the name is null?