Forum Xamarin.Android

BLE Scan works only when APP in foreground.

Nick.PNick.P GBMember ✭✭

Our Android application connects to our nRF52 (BLE) within 2..3 seconds while the APP in foreground. The Advertisement is picked during a periodic scan performed by a dedicated service.
When the APP is in background, although the scan is performed (proved by breakpoint, and an incrementing counter), there are no scan results.
As soon as the APP is bough into foreground, the scan picks the device normally.
Both the Android API StartScan() and the deprecated StartLeScan() have exactly the same behaviour.
What is required to make the scan work in the background ?

Best Answers


  • AlbertKAlbertK MYMember ✭✭✭✭


    You might want to try the Plugin-BLE, It takes care of most the plumbing for you and it works pretty well. The is a compile version in Nuget.

  • Nick.PNick.P GBMember ✭✭

    Thanks, this is interesting. However a brief search reveals that this plug-in has the same issue as me, using the raw native.

  • IlyaPonomarevIlyaPonomarev USMember ✭✭
    edited October 2017

    Hi. Could you please show your implementation? Got the same problem with scan in background.

Sign In or Register to comment.