public abstract class ScanCallback
extends Object



Bluetooth LE scan callbacks. Scan results are reported using these callbacks.

Summary

Constants

int SCAN_FAILED_ALREADY_STARTED

Fails to start scan as BLE scan with the same settings is already started by the app.

int SCAN_FAILED_APPLICATION_REGISTRATION_FAILED

Fails to start scan as app cannot be registered.

int SCAN_FAILED_FEATURE_UNSUPPORTED

Fails to start power optimized scan as this feature is not supported.

int SCAN_FAILED_INTERNAL_ERROR

Fails to start scan due an internal error

int SCAN_FAILED_OUT_OF_HARDWARE_RESOURCES

Fails to start scan as it is out of hardware resources.

int SCAN_FAILED_SCANNING_TOO_FREQUENTLY

Fails to start scan as application tries to scan too frequently.

Public constructors

ScanCallback()

Public methods

void onBatchScanResults(List<ScanResult> results)

Callback when batch results are delivered.

void onScanFailed(int errorCode)

Callback when scan could not be started.

void onScanResult(int callbackType, ScanResult result)

Callback when a BLE advertisement has been found.

Inherited methods

From class java.lang.Object

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Constants

SCAN_FAILED_ALREADY_STARTED

public static final int SCAN_FAILED_ALREADY_STARTED

Fails to start scan as BLE scan with the same settings is already started by the app.

Constant Value: 1 (0x00000001)

SCAN_FAILED_APPLICATION_REGISTRATION_FAILED

public static final int SCAN_FAILED_APPLICATION_REGISTRATION_FAILED

Fails to start scan as app cannot be registered.

Constant Value: 2 (0x00000002)

SCAN_FAILED_FEATURE_UNSUPPORTED

public static final int SCAN_FAILED_FEATURE_UNSUPPORTED

Fails to start power optimized scan as this feature is not supported.

Constant Value: 4 (0x00000004)

SCAN_FAILED_INTERNAL_ERROR

public static final int SCAN_FAILED_INTERNAL_ERROR

Fails to start scan due an internal error

Constant Value: 3 (0x00000003)

SCAN_FAILED_OUT_OF_HARDWARE_RESOURCES

public static final int SCAN_FAILED_OUT_OF_HARDWARE_RESOURCES

Fails to start scan as it is out of hardware resources.

Constant Value: 5 (0x00000005)

SCAN_FAILED_SCANNING_TOO_FREQUENTLY

public static final int SCAN_FAILED_SCANNING_TOO_FREQUENTLY

Fails to start scan as application tries to scan too frequently.

Constant Value: 6 (0x00000006)

Public constructors

ScanCallback

public ScanCallback ()

Public methods

onBatchScanResults

public void onBatchScanResults (List<ScanResult> results)

Callback when batch results are delivered.

Parameters
results List: List of scan results that are previously scanned.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-02-26 UTC.