title: Android altBeacon sometimes I get a beacons at 5 sek
body: <p>This is my activity :</p>
  <pre><code>public class MyActivity extends Activity implements BeaconConsumer, RangeNotifier {
  
      private BeaconManager mBeaconManager;
  
      @Override
      public void onResume() {
          super.onResume();
          mBeaconManager = BeaconManager.getInstanceForApplication(this.getApplicationContext());
          mBeaconManager.getBeaconParsers().add(new BeaconParser().
                  setBeaconLayout(BeaconParser.EDDYSTONE_UID_LAYOUT));
          mBeaconManager.getBeaconParsers().add(new BeaconParser().
                  setBeaconLayout(BeaconParser.EDDYSTONE_TLM_LAYOUT));
          mBeaconManager.setBackgroundBetweenScanPeriod(0);
          mBeaconManager.setBackgroundScanPeriod(1100);
          try {
              mBeaconManager.updateScanPeriods();
          } catch (RemoteException e) {
              e.printStackTrace();
          }
          mBeaconManager.bind(this);
      }
  
      public void onBeaconServiceConnect() {
          Region region = new Region(&quot;all-beacons-region&quot;, null, null, null);
          try {
              mBeaconManager.startRangingBeaconsInRegion(region);
          } catch (RemoteException e) {
              e.printStackTrace();
          }
          mBeaconManager.addRangeNotifier(this);
      }
  
      @Override
      public void didRangeBeaconsInRegion(Collection&lt;Beacon&gt; beacons, Region region) {
          Log.e(&quot;beacon size&quot; , beacons.size() + &quot;&quot;);
          for (Beacon beacon : beacons) {
                  // This is a Eddystone-UID frame
                  Identifier namespaceId = beacon.getId1();
                  Identifier instanceId = beacon.getId2();
                  Log.e(&quot;Beacon &quot;, beacon.getBluetoothName() +&quot; id: &quot; + namespaceId +
                          &quot; id2: &quot; + instanceId +
                          &quot; id3 &quot; + beacon.getId3());
  
                  // Do we have telemetry data?
                  if (beacon.getExtraDataFields().size() &gt; 0) {
                      long telemetryVersion = beacon.getExtraDataFields().get(0);
                      long batteryMilliVolts = beacon.getExtraDataFields().get(1);
                      long pduCount = beacon.getExtraDataFields().get(3);
                      long uptime = beacon.getExtraDataFields().get(4);
  
  
                  }
              }
  
      }
  
      @Override
      public void onPause() {
          super.onPause();
          mBeaconManager.unbind(this);
      }
  }
  </code></pre>
  <p>And a didRangeBeaconsInRegion get me sometimes a beacons array = 0 . Why ? I have a wait sometimes 3-4 sec to get not 0 size array .</p>
  <p>sometimes I have to wait a bit to get a non-empty becons board and I don't know why this is happening and what I'm doing wrong</p>