title: How to range beacons in background using Altbeacon: Android Beacon Library?
body: <p>I'm developing an app which provides background Beacon monitoring. I would like to start ranging when user enters beacon from defined region. When app is in background and it's monitoring all the time and user enters my defined region I would like to start ranging and get InstanceID or Major, Minor value to determine what beacon is that, connect to server and send user a notfication. The best would be if I could range and communicate with server in background. I used this sample to achieve background monitoring: <a href="https://altbeacon.github.io/android-beacon-library/samples.html" rel="nofollow">https://altbeacon.github.io/android-beacon-library/samples.html</a>. I also downloaded sample project from here: <a href="https://github.com/AltBeacon/android-beacon-library-reference" rel="nofollow">https://github.com/AltBeacon/android-beacon-library-reference</a> to base on it.</p>
  
  <p>Unfortunately in this example when user enters the region Activity is launched... I don't want that to happen. Soo my question is: Is it possible to range beacons in background?</p>
  
  <p>Also weird thing happens in my case beacause when I put my app in background method "didRangeBeaconsInRegion(Collection beacons, Region region)" is still called from MainActivity but no beacon is found. Also method is called less often because beaconManager is in background mode. When I launched sample project that was not happening. Maybe it's because I don't have monitoringActivity. My MainActivity does ranging instantly when launched. Of course I tried to setup everything exactly the same as it is in an example BeaconReferenceApplication.</p>
  
  <p>BTW I'm testing my app on Nexus 5 with Android 6.0.1</p>
  
  <p>Thank you in advance for any solutions!</p>