Estimote / Android-Fleet-Management-SDK

Estimote Fleet Management SDK for Android
https://developer.estimote.com
MIT License
836 stars 451 forks source link

setBackgroundScanPeriod or setForegroundScanPeriod not implemented? #9

Closed johnnyzen closed 10 years ago

johnnyzen commented 10 years ago

Hi there

setting either:

setBackgroundScanPeriod setForegroundScanPeriod

doesnt seem to have any effect?

Can anyone advise?

wiktor commented 10 years ago

That's correct. I pushed them by accident, they will be implemented in the next version of API.

LarryLan commented 10 years ago

what's the default scan frequency?

johnnyzen commented 10 years ago

ah cool. thanks for update. do you have timeframe for next version?

wiktor commented 10 years ago

That will be available next week.

Scan frequency for background is going to be probably: 25s sleeping, 5s scanning.

wiktor commented 10 years ago

Implemented with 0.3 version.

finishingmove commented 10 years ago

Not working in 0.4.2.

Can you verify this @wiktor ?

wiktor commented 10 years ago

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

finishingmove commented 10 years ago

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.

wiktor commented 10 years ago

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.

jorgetrejo commented 8 years ago

@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.emptyList());

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());
  }
});`