-
public class BeaconManager
A class used to set up interaction with beacons and start/stop beacon ranging/monitoring.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
BeaconManager.ServiceNotDeclaredException
-
Field Summary
Fields Modifier and Type Field Description private final List<BeaconParser>
beaconParsers
public final static long
DEFAULT_FOREGROUND_SCAN_PERIOD
public final static long
DEFAULT_FOREGROUND_BETWEEN_SCAN_PERIOD
public final static long
DEFAULT_BACKGROUND_SCAN_PERIOD
public final static long
DEFAULT_BACKGROUND_BETWEEN_SCAN_PERIOD
public final static long
DEFAULT_EXIT_PERIOD
private long
foregroundScanPeriod
private long
foregroundBetweenScanPeriod
private long
backgroundScanPeriod
private long
backgroundBetweenScanPeriod
protected static BeaconSimulator
beaconSimulator
protected static String
distanceModelUpdateUrl
protected static Class
rssiFilterImplClass
-
Method Summary
Modifier and Type Method Description List<BeaconParser>
getBeaconParsers()
Gets a list of the active beaconParsers. long
getForegroundScanPeriod()
void
setForegroundScanPeriod(long p)
Sets the duration in milliseconds of each Bluetooth LE scan cycle to look for beacons. long
getForegroundBetweenScanPeriod()
void
setForegroundBetweenScanPeriod(long p)
Sets the duration in milliseconds between each Bluetooth LE scan cycle to look for beacons. long
getBackgroundScanPeriod()
void
setBackgroundScanPeriod(long p)
Sets the duration in milliseconds of each Bluetooth LE scan cycle to look for beacons. long
getBackgroundBetweenScanPeriod()
void
setBackgroundBetweenScanPeriod(long p)
Sets the duration in milliseconds spent not scanning between each Bluetooth LE scan cycle when no ranging/monitoring clients are in the foreground static BeaconSimulator
getBeaconSimulator()
static void
setBeaconSimulator(BeaconSimulator beaconSimulator)
static String
getDistanceModelUpdateUrl()
static void
setDistanceModelUpdateUrl(@NonNull() String url)
static Class
getRssiFilterImplClass()
static void
setRssiFilterImplClass(@NonNull() Class c)
static void
setDebug(boolean debug)
Set to true if you want to show library debugging. RegionViewModel
getRegionViewModel(Region region)
LiveData object for getting beacon ranging and monitoring updates boolean
isRegionViewModelInitialized(Region region)
static void
setRegionExitPeriod(long regionExitPeriod)
Set region exit period in milliseconds static long
getRegionExitPeriod()
Get region exit milliseconds static BeaconManager
getInstanceForApplication(@NonNull() Context context)
An accessor for the singleton instance of this class. boolean
isMainProcess()
* Determines if this BeaconManager instance is associated with the main application process that hosts the user interface. boolean
isScannerInDifferentProcess()
Determines if this BeaconManager instance is not part of the process hosting the beacon scanning service. void
setScannerInSameProcess(boolean isScanner)
Reserved for internal use by the library. boolean
checkAvailability()
Check if Bluetooth LE is supported by this Android device, and if so, make sure it is enabled. void
bind(@NonNull() BeaconConsumer consumer)
Binds an Android Activity
orService
to theBeaconService
.void
bindInternal(@NonNull() InternalBeaconConsumer consumer)
void
handleStategyFailover()
Internal library use only. void
unbind(@NonNull() BeaconConsumer consumer)
Unbinds an Android Activity
orService
to theBeaconService
.void
unbindInternal(@NonNull() InternalBeaconConsumer consumer)
boolean
isBound(@NonNull() BeaconConsumer consumer)
Tells you if the passed beacon consumer is bound to the service boolean
isAnyConsumerBound()
Tells you if the any beacon consumer is bound to the service void
setBackgroundMode(boolean backgroundMode)
This method notifies the beacon service that the application is either moving to background mode or foreground mode. void
setBackgroundModeInternal(boolean backgroundMode)
Reserved for internal use by the library. void
setEnableScheduledScanJobs(boolean enabled)
Configures using a `ScanJob` run with the `JobScheduler` to perform scans rather than using a long-running `BeaconService` to do so. void
setIntentScanningStrategyEnabled(boolean enabled)
IntentScanStrategyCoordinator
getIntentScanStrategyCoordinator()
Internal use only by the library. boolean
getScheduledScanJobsEnabled()
boolean
getBackgroundMode()
boolean
isBackgroundModeUninitialized()
void
setRangeNotifier(@Nullable() RangeNotifier notifier)
Specifies a class that should be called each time the BeaconService
gets ranging data, which is nominally once per second when beacons are detected.void
addRangeNotifier(@NonNull() RangeNotifier notifier)
Specifies a class that should be called each time the BeaconService
gets ranging data, which is nominally once per second when beacons are detected.boolean
removeRangeNotifier(@NonNull() RangeNotifier notifier)
Specifies a class to remove from the array of RangeNotifier
void
removeAllRangeNotifiers()
Remove all the Range Notifiers. void
setMonitorNotifier(@Nullable() MonitorNotifier notifier)
Specifies a class that should be called each time the BeaconService
sees or stops seeing a Region of beacons.void
addMonitorNotifier(@NonNull() MonitorNotifier notifier)
Specifies a class that should be called each time the BeaconService
sees or stops seeing a Region of beacons.boolean
removeMonitoreNotifier(@NonNull() MonitorNotifier notifier)
boolean
removeMonitorNotifier(@NonNull() MonitorNotifier notifier)
Specifies a class to remove from the array of MonitorNotifier
.void
removeAllMonitorNotifiers()
Remove all the Monitor Notifiers. void
setRegionStatePeristenceEnabled(boolean enabled)
void
setRegionStatePersistenceEnabled(boolean enabled)
Turns off saving the state of monitored regions to persistent storage so it is retained over app restarts. boolean
isRegionStatePersistenceEnabled()
Indicates whether region state preservation is enabled void
requestStateForRegion(@NonNull() Region region)
Requests the current in/out state on the specified region. void
startRangingBeaconsInRegion(@NonNull() Region region)
Tells the BeaconService
to start looking for beacons that match the passedRegion
object, and providing updates on the estimated mDistance every seconds while beacons in the Region are visible.void
startRangingBeacons(@NonNull() Region region)
Tells the BeaconService
tteo start looking for beacons that match the passedRegion
object, and providing updates on the estimated mDistance every seconds while beacons in the Region are visible.void
stopRangingBeaconsInRegion(@NonNull() Region region)
Tells the BeaconService
to stop looking for beacons that match the passedRegion
object and providing mDistance information for them.void
stopRangingBeacons(@NonNull() Region region)
Tells the library to stop looking for beacons that match the passed Region
object and providing distance information for them.void
applySettings()
Call this method if you are running the scanner service in a different process in order to synchronize any configuration settings, including BeaconParsers to the scanner void
startMonitoringBeaconsInRegion(@NonNull() Region region)
Tells the BeaconService
to start looking for beacons that match the passedRegion
object.void
startMonitoring(@NonNull() Region region)
Tells the BeaconService
to start looking for beacons that match the passedRegion
object.void
stopMonitoringBeaconsInRegion(@NonNull() Region region)
Tells the library to stop looking for beacons that match the passed Region
object.void
stopMonitoring(@NonNull() Region region)
Tells the library to stop looking for beacons that match the passed Region
object.void
updateScanPeriods()
Updates an already running scan with scanPeriod/betweenScanPeriod according to Background/Foreground state. MonitorNotifier
getMonitoringNotifier()
Set<MonitorNotifier>
getMonitoringNotifiers()
Read-only access to the registered MonitorNotifier instances This provides a thread-safe "read-only" view of the Set of registered monitor notifiers. RangeNotifier
getRangingNotifier()
Set<RangeNotifier>
getRangingNotifiers()
Read-only access to the registered RangeNotifier instances This provides a thread-safe "read-only" view of the Set of registered range notifiers. Collection<Region>
getMonitoredRegions()
static void
logDebug(String tag, String message)
Convenience method for logging debug by the library static void
logDebug(String tag, String message, Throwable t)
Convenience method for logging debug by the library static void
setUseTrackingCache(boolean useTrackingCache)
Allow the library to use a tracking cache void
setMaxTrackingAge(int maxTrackingAge)
Set the period of time, in which a beacon did not receive new measurements NonBeaconLeScanCallback
getNonBeaconLeScanCallback()
void
setNonBeaconLeScanCallback(@Nullable() NonBeaconLeScanCallback callback)
static boolean
isAndroidLScanningDisabled()
Determines if Android L Scanning is disabled by user selection static void
setAndroidLScanningDisabled(boolean disabled)
Allows disabling use of Android L BLE Scanning APIs on devices with API 21+ If set to false (default), devices with API 21+ will use the Android L APIs to scan for beacons static void
setsManifestCheckingDisabled(boolean disabled)
Deprecated misspelled method static void
setManifestCheckingDisabled(boolean disabled)
Allows disabling check of manifest for proper configuration of service. static boolean
getManifestCheckingDisabled()
Returns whether manifest checking is disabled void
enableForegroundServiceScanning(Notification notification, int notificationId)
Configures the library to use a foreground service for bacon scanning. void
disableForegroundServiceScanning()
Disables a foreground scanning service, if previously configured. Notification
getForegroundServiceNotification()
int
getForegroundServiceNotificationId()
boolean
isAutoBindActive()
boolean
shutdownIfIdle()
When using auto-bind, this method will shut down the foreground service or scheduled jobs needed to keep scanning going if there are no longer any ranged or monitored regions. -
-
Method Detail
-
getBeaconParsers
@NonNull() List<BeaconParser> getBeaconParsers()
Gets a list of the active beaconParsers.
-
getForegroundScanPeriod
long getForegroundScanPeriod()
-
setForegroundScanPeriod
void setForegroundScanPeriod(long p)
Sets the duration in milliseconds of each Bluetooth LE scan cycle to look for beacons. This function is used to setup the period before calling bind or when switching between background/foreground. To have it effect on an already running scan (when the next cycle starts), call updateScanPeriods
-
getForegroundBetweenScanPeriod
long getForegroundBetweenScanPeriod()
-
setForegroundBetweenScanPeriod
void setForegroundBetweenScanPeriod(long p)
Sets the duration in milliseconds between each Bluetooth LE scan cycle to look for beacons. This function is used to setup the period before calling bind or when switching between background/foreground. To have it effect on an already running scan (when the next cycle starts), call updateScanPeriods
-
getBackgroundScanPeriod
long getBackgroundScanPeriod()
-
setBackgroundScanPeriod
void setBackgroundScanPeriod(long p)
Sets the duration in milliseconds of each Bluetooth LE scan cycle to look for beacons. This function is used to setup the period before calling bind or when switching between background/foreground. To have it effect on an already running scan (when the next cycle starts), call updateScanPeriods
-
getBackgroundBetweenScanPeriod
long getBackgroundBetweenScanPeriod()
-
setBackgroundBetweenScanPeriod
void setBackgroundBetweenScanPeriod(long p)
Sets the duration in milliseconds spent not scanning between each Bluetooth LE scan cycle when no ranging/monitoring clients are in the foreground
-
getBeaconSimulator
@Nullable() static BeaconSimulator getBeaconSimulator()
-
setBeaconSimulator
static void setBeaconSimulator(BeaconSimulator beaconSimulator)
-
getDistanceModelUpdateUrl
static String getDistanceModelUpdateUrl()
-
setDistanceModelUpdateUrl
static void setDistanceModelUpdateUrl(@NonNull() String url)
-
getRssiFilterImplClass
static Class getRssiFilterImplClass()
-
setRssiFilterImplClass
static void setRssiFilterImplClass(@NonNull() Class c)
-
setDebug
static void setDebug(boolean debug)
Set to true if you want to show library debugging.
- Parameters:
debug
- True turn on all logs for this library to be printed out to logcat.
-
getRegionViewModel
@NonNull() RegionViewModel getRegionViewModel(Region region)
LiveData object for getting beacon ranging and monitoring updates
-
isRegionViewModelInitialized
boolean isRegionViewModelInitialized(Region region)
-
setRegionExitPeriod
static void setRegionExitPeriod(long regionExitPeriod)
Set region exit period in milliseconds
-
getRegionExitPeriod
static long getRegionExitPeriod()
Get region exit milliseconds
-
getInstanceForApplication
@NonNull() static BeaconManager getInstanceForApplication(@NonNull() Context context)
An accessor for the singleton instance of this class. A context must be provided, but if you need to use it from a non-Activity or non-Service class, you can attach it to another singleton or a subclass of the Android Application class.
-
isMainProcess
boolean isMainProcess()
* Determines if this BeaconManager instance is associated with the main application process that hosts the user interface. This is normally true unless the scanning service or another servide is running in a separate process.
-
isScannerInDifferentProcess
boolean isScannerInDifferentProcess()
Determines if this BeaconManager instance is not part of the process hosting the beacon scanning service. This is normally false, except when scanning is hosted in a different process. This will always return false until the scanning service starts up, at which time it will be known if it is in a different process.
-
setScannerInSameProcess
void setScannerInSameProcess(boolean isScanner)
Reserved for internal use by the library.
-
checkAvailability
boolean checkAvailability()
Check if Bluetooth LE is supported by this Android device, and if so, make sure it is enabled.
-
bind
@Deprecated() void bind(@NonNull() BeaconConsumer consumer)
Binds an Android
Activity
orService
to theBeaconService
. TheActivity
orService
must implement thebeaconConsumer
interface so that it can get a callback when the service is ready to use.- Parameters:
consumer
- theActivity
orService
that will receive the callback when the service is ready.
-
bindInternal
void bindInternal(@NonNull() InternalBeaconConsumer consumer)
-
handleStategyFailover
void handleStategyFailover()
Internal library use only. This will trigger a failover from the intent scan strategy to jobs or a foreground service
-
unbind
@Deprecated() void unbind(@NonNull() BeaconConsumer consumer)
Unbinds an Android
Activity
orService
to theBeaconService
. This should typically be called in the onDestroy() method.- Parameters:
consumer
- theActivity
orService
that no longer needs to use the service.
-
unbindInternal
void unbindInternal(@NonNull() InternalBeaconConsumer consumer)
-
isBound
@Deprecated() boolean isBound(@NonNull() BeaconConsumer consumer)
Tells you if the passed beacon consumer is bound to the service
-
isAnyConsumerBound
boolean isAnyConsumerBound()
Tells you if the any beacon consumer is bound to the service
-
setBackgroundMode
@Deprecated() void setBackgroundMode(boolean backgroundMode)
This method notifies the beacon service that the application is either moving to background mode or foreground mode. When in background mode, BluetoothLE scans to look for beacons are executed less frequently in order to save battery life. The specific scan rates for background and foreground operation are set by the defaults below, but may be customized. When ranging in the background, the time between updates will be much less frequent than in the foreground. Updates will come every time interval equal to the sum total of the BackgroundScanPeriod and the BackgroundBetweenScanPeriod.
- Parameters:
backgroundMode
- true indicates the app is in the background
-
setBackgroundModeInternal
void setBackgroundModeInternal(boolean backgroundMode)
Reserved for internal use by the library.
-
setEnableScheduledScanJobs
void setEnableScheduledScanJobs(boolean enabled)
Configures using a `ScanJob` run with the `JobScheduler` to perform scans rather than using a long-running `BeaconService` to do so. Calling with true on devices older than Android L (5.0) will not apply the change as the JobScheduler is not available. This value defaults to true on Android O+ and false on devices with older OS versions. Accepting the default value of false is recommended on Android N and earlier because otherwise beacon scans may be run only once every 15 minutes in the background, and no low power scans may be performed between scanning cycles. Setting this value to false will disable ScanJobs when the app is run on Android 8+, which can prohibit delivery of callbacks when the app is in the background unless the scanning process is running in a foreground service. This method may only be called if ranging or monitoring have not yet been started otherwise an `IllegalStateException` is thrown.
-
setIntentScanningStrategyEnabled
void setIntentScanningStrategyEnabled(boolean enabled)
-
getIntentScanStrategyCoordinator
IntentScanStrategyCoordinator getIntentScanStrategyCoordinator()
Internal use only by the library.
-
getScheduledScanJobsEnabled
boolean getScheduledScanJobsEnabled()
-
getBackgroundMode
boolean getBackgroundMode()
-
isBackgroundModeUninitialized
boolean isBackgroundModeUninitialized()
-
setRangeNotifier
@Deprecated() void setRangeNotifier(@Nullable() RangeNotifier notifier)
Specifies a class that should be called each time the
IMPORTANT: Only one RangeNotifier may be active for a given application. If two different activities or services set different RangeNotifier instances, the last one set will receive all the notifications.BeaconService
gets ranging data, which is nominally once per second when beacons are detected.- Parameters:
notifier
- The RangeNotifier to register.
-
addRangeNotifier
void addRangeNotifier(@NonNull() RangeNotifier notifier)
Specifies a class that should be called each time the
Permits to register severalBeaconService
gets ranging data, which is nominally once per second when beacons are detected.RangeNotifier
objects. The notifier must be unregistered using (@link #removeRangeNotifier)- Parameters:
notifier
- The RangeNotifier to register.
-
removeRangeNotifier
boolean removeRangeNotifier(@NonNull() RangeNotifier notifier)
Specifies a class to remove from the array of
RangeNotifier
- Parameters:
notifier
- The RangeNotifier to unregister.
-
removeAllRangeNotifiers
void removeAllRangeNotifiers()
Remove all the Range Notifiers.
-
setMonitorNotifier
@Deprecated() void setMonitorNotifier(@Nullable() MonitorNotifier notifier)
Specifies a class that should be called each time the
IMPORTANT: Only one MonitorNotifier may be active for a given application. If two different activities or services set different MonitorNotifier instances, the last one set will receive all the notifications.BeaconService
sees or stops seeing a Region of beacons.- Parameters:
notifier
- The MonitorNotifier to register.
-
addMonitorNotifier
void addMonitorNotifier(@NonNull() MonitorNotifier notifier)
Specifies a class that should be called each time the
Permits to register severalBeaconService
sees or stops seeing a Region of beacons.MonitorNotifier
objects. Unregister the notifier using removeMonitoreNotifier- Parameters:
notifier
- The MonitorNotifier to register.
-
removeMonitoreNotifier
@Deprecated() boolean removeMonitoreNotifier(@NonNull() MonitorNotifier notifier)
-
removeMonitorNotifier
boolean removeMonitorNotifier(@NonNull() MonitorNotifier notifier)
Specifies a class to remove from the array of
MonitorNotifier
.- Parameters:
notifier
- The MonitorNotifier to unregister.
-
removeAllMonitorNotifiers
void removeAllMonitorNotifiers()
Remove all the Monitor Notifiers.
-
setRegionStatePeristenceEnabled
@Deprecated() void setRegionStatePeristenceEnabled(boolean enabled)
-
setRegionStatePersistenceEnabled
void setRegionStatePersistenceEnabled(boolean enabled)
Turns off saving the state of monitored regions to persistent storage so it is retained over app restarts. Defaults to enabled. When enabled, there will not be an "extra" region entry event when the app starts up and a beacon for a monitored region was previously visible within the past 15 minutes. Note that there is a limit to 50 monitored regions that may be persisted. If more than 50 regions are monitored, state is not persisted for any.
- Parameters:
enabled
- true to enable the region state persistence, false to disable it.
-
isRegionStatePersistenceEnabled
boolean isRegionStatePersistenceEnabled()
Indicates whether region state preservation is enabled
-
requestStateForRegion
void requestStateForRegion(@NonNull() Region region)
Requests the current in/out state on the specified region. If the region is being monitored, this will cause an asynchronous callback on the `MonitorNotifier`'s `didDetermineStateForRegion` method. If it is not a monitored region, it will be ignored.
-
startRangingBeaconsInRegion
@Deprecated() void startRangingBeaconsInRegion(@NonNull() Region region)
Tells the
BeaconService
to start looking for beacons that match the passedRegion
object, and providing updates on the estimated mDistance every seconds while beacons in the Region are visible. Note that the Region's unique identifier must be retained to later call the stopRangingBeaconsInRegion method.
-
startRangingBeacons
void startRangingBeacons(@NonNull() Region region)
Tells the
BeaconService
tteo start looking for beacons that match the passedRegion
object, and providing updates on the estimated mDistance every seconds while beacons in the Region are visible. Note that the Region's unique identifier must be retained to later call the stopRangingBeaconsInRegion method. This is an auto-binding variant of the call that relies on a single beacon consumer. Do not combine calls to this method with manual calls to bind() and unbind().
-
stopRangingBeaconsInRegion
@Deprecated() void stopRangingBeaconsInRegion(@NonNull() Region region)
Tells the
BeaconService
to stop looking for beacons that match the passedRegion
object and providing mDistance information for them.
-
stopRangingBeacons
void stopRangingBeacons(@NonNull() Region region)
Tells the library to stop looking for beacons that match the passed
Region
object and providing distance information for them.
-
applySettings
void applySettings()
Call this method if you are running the scanner service in a different process in order to synchronize any configuration settings, including BeaconParsers to the scanner
-
startMonitoringBeaconsInRegion
@Deprecated() void startMonitoringBeaconsInRegion(@NonNull() Region region)
Tells the
BeaconService
to start looking for beacons that match the passedRegion
object. Note that the Region's unique identifier must be retained to later call the stopMonitoringBeaconsInRegion method.
-
startMonitoring
void startMonitoring(@NonNull() Region region)
Tells the
BeaconService
to start looking for beacons that match the passedRegion
object. Note that the Region's unique identifier must be retained to later call the stopMonitoringBeaconsInRegion method.
-
stopMonitoringBeaconsInRegion
@Deprecated() void stopMonitoringBeaconsInRegion(@NonNull() Region region)
Tells the library to stop looking for beacons that match the passed
Region
object. Note that the Region's unique identifier is used to match it to an existing monitored Region.
-
stopMonitoring
void stopMonitoring(@NonNull() Region region)
Tells the library to stop looking for beacons that match the passed
Region
object. Note that the Region's unique identifier is used to match it to an existing monitored Region.
-
updateScanPeriods
void updateScanPeriods()
Updates an already running scan with scanPeriod/betweenScanPeriod according to Background/Foreground state. Change will take effect on the start of the next scan cycle.
-
getMonitoringNotifier
@Deprecated()@Nullable() MonitorNotifier getMonitoringNotifier()
-
getMonitoringNotifiers
@NonNull() Set<MonitorNotifier> getMonitoringNotifiers()
Read-only access to the registered MonitorNotifier instances
This provides a thread-safe "read-only" view of the Set of registered monitor notifiers. Attempts to modify the returned set, or its iterator, will throw an UnsupportedOperationException. Modifications to the underlying set should be made through addMonitorNotifier and removeMonitorNotifier.
-
getRangingNotifier
@Deprecated()@Nullable() RangeNotifier getRangingNotifier()
-
getRangingNotifiers
@NonNull() Set<RangeNotifier> getRangingNotifiers()
Read-only access to the registered RangeNotifier instances
This provides a thread-safe "read-only" view of the Set of registered range notifiers. Attempts to modify the returned set, or its iterator, will throw an UnsupportedOperationException. Modifications to the underlying set should be made through addRangeNotifier and removeRangeNotifier.
-
getMonitoredRegions
@NonNull() Collection<Region> getMonitoredRegions()
-
logDebug
@Deprecated() static void logDebug(String tag, String message)
Convenience method for logging debug by the library
-
logDebug
@Deprecated() static void logDebug(String tag, String message, Throwable t)
Convenience method for logging debug by the library
-
setUseTrackingCache
static void setUseTrackingCache(boolean useTrackingCache)
Allow the library to use a tracking cache
-
setMaxTrackingAge
void setMaxTrackingAge(int maxTrackingAge)
Set the period of time, in which a beacon did not receive new measurements
- Parameters:
maxTrackingAge
- in milliseconds
-
getNonBeaconLeScanCallback
@Nullable() NonBeaconLeScanCallback getNonBeaconLeScanCallback()
-
setNonBeaconLeScanCallback
void setNonBeaconLeScanCallback(@Nullable() NonBeaconLeScanCallback callback)
-
isAndroidLScanningDisabled
static boolean isAndroidLScanningDisabled()
Determines if Android L Scanning is disabled by user selection
-
setAndroidLScanningDisabled
static void setAndroidLScanningDisabled(boolean disabled)
Allows disabling use of Android L BLE Scanning APIs on devices with API 21+ If set to false (default), devices with API 21+ will use the Android L APIs to scan for beacons
-
setsManifestCheckingDisabled
@Deprecated() static void setsManifestCheckingDisabled(boolean disabled)
Deprecated misspelled method
-
setManifestCheckingDisabled
static void setManifestCheckingDisabled(boolean disabled)
Allows disabling check of manifest for proper configuration of service. Useful for unit testing
-
getManifestCheckingDisabled
static boolean getManifestCheckingDisabled()
Returns whether manifest checking is disabled
-
enableForegroundServiceScanning
void enableForegroundServiceScanning(Notification notification, int notificationId)
Configures the library to use a foreground service for bacon scanning. This allows nearly constant scanning on most Android versions to get around background limits, and displays an icon to the user to indicate that the app is doing something in the background, even on Android 8+. This will disable the user of the JobScheduler on Android 8 to do scans. Note that this method does not by itself enable constant scanning. The scan intervals will work as normal and must be configurd to specific values depending on how often you wish to scan.
- Parameters:
notification
- - the notification that will be displayed when beacon scanning is active, along with the icon that shows up in the status bar.
-
disableForegroundServiceScanning
void disableForegroundServiceScanning()
Disables a foreground scanning service, if previously configured.
-
getForegroundServiceNotification
Notification getForegroundServiceNotification()
-
getForegroundServiceNotificationId
int getForegroundServiceNotificationId()
-
isAutoBindActive
boolean isAutoBindActive()
-
shutdownIfIdle
boolean shutdownIfIdle()
When using auto-bind, this method will shut down the foreground service or scheduled jobs needed to keep scanning going if there are no longer any ranged or monitored regions.
-
-
-
-