This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Best scanning rate to avoid phone's battery drain in background mode.

Hi guys

I am planning to develop a beacon app, but I am not sure what would be the minimum scanning interval in order to keep the phone's battery drain on a fairly good level. The app must keep scanning in the background mode.

Do you know any technical report ?

Thanks in advance!

  • Hello,

    We have released two beacon scanning projects on GitHub: the nRF Beacon (scans for iBeacons, Android and iOS) and nRF Beacon for Eddystone (Android only, scans for Eddystone beacons).

    If you decide to scan for Eddystone beacons I recommend to use the Google Play Services -> Nearby Messages API. Then the GPS takes care of the scanning and your app automatically receives attachments associated with the registered beacon in Proximity API. This also works on iOS (with some restrictions). You will find more info here.

    If you decide to scan for iBeacons you will have a bit better on iOS, where you simply register your app to be notified about required UUID/major/minor, but slightly more work on Android. You also won't get registered attachments automatically, at least for now (unless you use a 3rd party solution, like Estimote's). Then on Android you have to implement scanning yourselves. f you want to use background scanning you should use a service and use LOW_POWER scanning mode. If you want your app to be compatible backwards for Android 4.3 I would suggest using our Android Scanner Compat library. It brings all the 5+ features to 4.3, also giving you option to scan in periods for pre-Lollipop devices. You should also use filters so that your app is only notified about beacons matching a pattern. Hardware filtering lowers the battery consumption, but it was observed on some devices that it may not work, so you may also make use of this method for those devices.

    To summarize, I would suggest to go into Eddystone format, as this is an open standard and Google supports it well for both platforms. You then can choose what kind of beacons are you interested in: UID, EID, URL, and get some telemetry information if needed. For UID and EID the Nearby Messages API is a perfect solution. You even don't need to know any BLE API. Please, see our nRF Beacon for Eddystone sample for Android.

    HTH, Aleksander

  • Hi Aleksander

    Thank you very much for your complete answer. I checked all the information you provided.

    Do you know how often the Nearby Messages API scans in background mode for eddystone beacons? What about iBeacon IOS ?

    It is extremely important to know those times, in order to check app's viability.

    Thanks in advance!

  • I'm pretty sure nearby is also using scanning in low power, so it's around a second and then 5 sec break. You can check it in nRF Connect if you have a device that advertisers quite fast. Go to Settings->Scanner and for each mode scan for 15 sec and then open device details with MORE button. The graph on the top will show when packets were captured. As for the ios and ibeacons I don't know but from my experience is pretty fast even in background. But here you would have to check other sources or see the documentation, if such exists.

Related