I am trying to change the scan period with android beacon library. This is my code
BeaconManager beaconManager = BeaconManager.getInstanceForApplication(this);
beaconManager = BeaconManager.getInstanceForApplication(this);
beaconManager.getBeaconParsers().add(new BeaconParser().
setBeaconLayout("m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24"));
beaconManager.bind(this);
try {
beaconManager.setForegroundScanPeriod(50l); // 1100 mS
beaconManager.setForegroundBetweenScanPeriod(0l); // 0ms
beaconManager.updateScanPeriods();
}
catch (RemoteException e) {
Log.e("error", e.getMessage());
}
I tried different devices but I always get this error The BeaconManager is not bound to the service. Call beaconManager.bind(BeaconConsumer consumer) and wait for a callback to onBeaconServiceConnect()
I think the value of the scan period changes even if I get this error but I am not sure