Android library to scan for iBeacons.
Clone or download
qbraet Merge pull request #22 from inthepocket/feature/Android_O_BLE_scannin…

Feature/android o ble scanning support
Latest commit e2af105 Apr 30, 2018

iBeacon scanner android

Build Status MIT License

Android library to scan for iBeacons.

Download the library

You can download the library via Gradle from the jCenter repository:

repositories {

By adding the dependency in your module level build.gradle:

dependencies {
    compile ''


If you want to scan for beacons in an activity or service, first initialize the library in your application class: You need to set a target service to receive beacon notifications. This API has changed since the introduction of Android 8, we can only start JobIntentServices in the background. All beacon intents will be handled in this JobIntentService.

public class MyApplication extends Application
    public void onCreate()

        // initialize

Get notified of iBeacon enters and exits

You need the JobIntentService (described above) to receive beacon enters and exits.

public class BeaconActivityService extends JobIntentService
    protected void onHandleWork(@NonNull final Intent intent)
        // This is the beacon object containing UUID, major and minor info
        final Beacon beacon = intent.getParcelableExtra(BluetoothScanBroadcastReceiver.IBEACON_SCAN_BEACON_DETECTION);
        // This flag will be true if it is an enter event that triggered this service
        final boolean enteredBeacon = intent.getBooleanExtra(BluetoothScanBroadcastReceiver.IBEACON_SCAN_BEACON_ENTERED, false);
        // This flag will be true if it is an exit event that triggered this service
        final boolean exitedBeacon = intent.getBooleanExtra(BluetoothScanBroadcastReceiver.IBEACON_SCAN_BEACON_EXITED, false);
        // Here you can do something with the beacon trigger

Create a Beacon object

final Beacon beacon = Beacon.newBuilder()

Pass beacons you want to monitor

Pass one or more beacons to the library to start getting enter or exit notifies:



IBEACON-SCANNER-ANDROID is freely distributable under the terms of the MIT license.