Closed johnnyzen closed 10 years ago
That's correct. I pushed them by accident, they will be implemented in the next version of API.
what's the default scan frequency?
ah cool. thanks for update. do you have timeframe for next version?
That will be available next week.
Scan frequency for background is going to be probably: 25s sleeping, 5s scanning.
Implemented with 0.3 version.
Not working in 0.4.2.
Can you verify this @wiktor ?
It is working. See notification example.
On Mon, Aug 4, 2014 at 4:29 PM, finishingmove notifications@github.com wrote:
Not working in 0.4.2.
Can you verify this @wiktor ?
Reply to this email directly or view it on GitHub: https://github.com/Estimote/Android-SDK/issues/9#issuecomment-51067148
Here's what happens in my app that uses the 0.4.2 release:
onCreate:
beaconManager.setBackgroundScanPeriod(TimeUnit.SECONDS.toMillis(1), 0);
beaconManager.setMonitoringListener(new BeaconManager.MonitoringListener() {
// ...
@Override
public void onEnteredRegion(Region region, List<Beacon> beacons) {
Log.d("BEACONS", "onEnteredRegion");
// ...
}
});
onStart:
beaconManager.startMonitoring(REGION);
beaconManager.startRanging(REGION);
Logcat:
D/EstimoteSDK﹕ com.estimote.sdk.service.BeaconService$IncomingHandler$1.run:497 Setting background scan period: ScanPeriodData{scanPeriodMillis=5000, waitTimeMillis=30000}
and the Log gets executed every 25 seconds.
Ranging listener and other parts of code omitted for brevity.
Haha :), that silly of me. I had put log statement before setting the value. The scan period is being changed but log actually displays previous value.
I'll fix it.
@wiktor I want to set this variables *beaconManager.setBackgroundScanPeriod(TimeUnit.SECONDS.toMillis(10), 0); beaconManager.setForegroundScanPeriod(TimeUnit.SECONDS.toMillis(10), 0); , but its only can configure in onCreate, Exist a way to configure another place, and set variables when app is running ?
For example in:
` protected void startScanning() {
toolbar.setSubtitle("Buscando salas cercanas...");
adapter.replaceWith(Collections.
beaconManager.setNearableListener(new BeaconManager.NearableListener() {
@Override public void onNearablesDiscovered(List<Nearable> nearables) {
/*beaconManager.setBackgroundScanPeriod(TimeUnit.SECONDS.toMillis(10), 0);
beaconManager.setForegroundScanPeriod(TimeUnit.SECONDS.toMillis(10), 0);
*/
adapter.replaceWith(nearables);
toolbar.setSubtitle("Salas cercanas encontradas: " + nearables.size());
}
});`
Hi there
setting either:
setBackgroundScanPeriod setForegroundScanPeriod
doesnt seem to have any effect?
Can anyone advise?