title: Android Beacon Library detecting iBeacon fails! not fair :(
body: <p>I try to use the Android Beacon Library to detect iBeacons but it doesn't work.</p>
  
  <p>The output from the logcat ist just:</p>
  
  <p><code>I/SELinux﹕ Function: selinux_android_load_priority [0], There is no sepolicy file.
  I/SELinux﹕ Function: selinux_android_load_priority , spota verifySig and checkHash pass. priority version is VE=SEPF_GT-I9195_4.4.2_0046
  I/SELinux﹕ selinux_android_seapp_context_reload: seapp_contexts file is loaded from /data/security/spota/seapp_contexts
  E/dalvikvm﹕ &gt;&gt;&gt;&gt;&gt; Normal User
  E/dalvikvm﹕ &gt;&gt;&gt;&gt;&gt; com.cyberland.felix.ibeaconexample [ userId:0 | appId:10176 ]
  D/dalvikvm﹕ Late-enabling CheckJNI
  I/PersonaManager﹕ getPersonaService() name persona_policy
  D/BeaconParser﹕ Parsing beacon layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
  D/BeaconParser﹕ Parsing beacon layout: m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24
  W/ModelSpecificDistanceCalculator﹕ Cannot find match for this device.  Using default
  W/ModelSpecificDistanceCalculator﹕ Cannot find match for this device.  Using default
  E/MonitoringStatus﹕ Deserialization exception, message: $s
  </code></p>
  
  <p>And then just </p>
  
  <p><code>D/BluetoothAdapter﹕ stopLeScan()</code></p>
  
  <p>again and again...</p>
  
  <p>I just modified the example from the oficial page:</p>
  
  <pre><code>public class MainActivity extends Activity implements BeaconConsumer {
  protected static final String TAG = "MainActivity";
  private BeaconManager beaconManager;
  private static final int PERMISSION_REQUEST_COARSE_LOCATION = 1;
  
  private BluetoothAdapter mBluetoothAdapter;
  
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      /*
      mBluetoothAdapter = ((BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter();
      mBluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
          @Override
          public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) {
              Log.d(TAG, "Scanned BLE device with mac: " + device.getAddress());
          }
      });
       */
      beaconManager = BeaconManager.getInstanceForApplication(this);
      beaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));
      beaconManager.bind(this);
  
  
  
  
  }
  
  
  @Override
  protected void onDestroy() {
      super.onDestroy();
      beaconManager.unbind(this);
  
  }
  
  
  @Override
  public void onBeaconServiceConnect() {
      beaconManager.setRangeNotifier(new RangeNotifier() {
          @Override
          public void didRangeBeaconsInRegion(Collection&lt;Beacon&gt; beacons, Region region) {
              if (beacons.size() &gt; 0) {
                  Log.i(TAG, "The first beacon I see is about " + beacons.iterator().next().getDistance() + " meters away.");
              }
          }
      });
  
      try {
          beaconManager.startRangingBeaconsInRegion(new Region("myRangingUniqueId", null, null, null));
      } catch (RemoteException e) {    }
  }
  </code></pre>
  
  <p>I hope you can help me!</p>
  
  <p>Best regards,
  Felix</p>