Hi. I’m creating an Android app which does regular scans for beacons. I use a background service to start ranging, allow a short time (around five seconds) then stop scanning. The scan is repeated every minute or so.
It generally works fine, and although I allow five seconds, it usually picks up all four of my test beacons in the first second or two. Sometimes however, it simply won’t detect any beacons at all. This may happen once or twice randomly, and then suddenly it will detect them all again immediately.
I’m trying to work out why this is, and would appreciate any ideas. Is it the device restricting availability or the network or bluetooth? If so is there any code I can call to wake these features up? I know bluetooth is on, but for example it may be somehow put to sleep after the last scan. I’m just guessing, so any clues welcome! Thanks.