I have an app that will detect Ibeacons using android beacon library
I am able to detect beacons in entry region .But the exit region code is not all working.
1.First i will detect all the beacons around my app 2.Will start monitoring each beacon
public void onBeaconServiceConnect() {
// TODO Auto-generated method stub
albeaconMnager.setRangeNotifier(new RangeNotifier() {
@Override
public void didRangeBeaconsInRegion(
Collection<org.altbeacon.beacon.Beacon> beacons,org.altbeacon.beacon.Region arg1) {
if(beacons.size()>0)
{
try {
albeaconMnager.startMonitoringBeaconsInRegion(new org.altbeacon.beacon.Region("Regionid", beacons.iterator().next().getId1(), beacons.iterator().next().getId2(), beacons.iterator().next().getId3()));
} catch (RemoteException e) {
// TODO Auto-generated catch bl
e.printStackTrace();
}
}
// TODO Auto-generated method stub
}
});
albeaconMnager.setMonitorNotifier(new MonitorNotifier() {
@Override
public void didExitRegion(org.altbeacon.beacon.Region arg0) {
// TODO Auto-generated method stub
Log.i("tAG", "Exited Beacon!"+arg0.getUniqueId());
}
@Override
public void didEnterRegion(org.altbeacon.beacon.Region arg0) {
// TODO Auto-generated method stub
connectToAppHandler(arg0.getId1().toString(),"entry");
}
@Override
public void didDetermineStateForRegion(int state,
org.altbeacon.beacon.Region arg1) {
// TODO Auto-generated method stub
}
});
try {
albeaconMnager.startRangingBeaconsInRegion(new org.altbeacon.beacon.Region("Regionid", null, null, null));
//final Context context = this.getApplicationContext();
}
catch (RemoteException e)
{
}
}
}
Please help