i'm using the AltBeacon library to detect an iBeacon device. This is the code that i use, based on the AltBeacon's documentation, but the beacon is not detected:
beaconManager = BeaconManager.getInstanceForApplication(this);
beaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));
beaconManager.bind(this);
beaconManager.addMonitorNotifier(new MonitorNotifier() {
@Override
public void didEnterRegion(Region region) {
Log.i("test", "I just saw an beacon for the first time!");
}
@Override
public void didExitRegion(Region region) {
Log.i("test", "I no longer see an beacon");
}
@Override
public void didDetermineStateForRegion(int state, Region region) {
Log.i("test", "I have just switched from seeing/not seeing beacons: "+state);
}
});
try {
beaconManager.startMonitoringBeaconsInRegion(new Region("e2c56db5-dffb-48d2-b060-d0f5a71096e0", null, null, null));
} catch (RemoteException e) { }
Is this code wrong?