Package com.cheetahdigital.beacons.ui
Class BeaconManager
- java.lang.Object
-
- com.cheetahdigital.beacons.ui.BeaconManager
-
- All Implemented Interfaces:
org.altbeacon.beacon.BeaconConsumer
,org.altbeacon.beacon.MonitorNotifier
,org.altbeacon.beacon.RangeNotifier
,org.altbeacon.beacon.startup.BootstrapNotifier
public class BeaconManager extends java.lang.Object implements org.altbeacon.beacon.RangeNotifier, org.altbeacon.beacon.MonitorNotifier, org.altbeacon.beacon.BeaconConsumer, org.altbeacon.beacon.startup.BootstrapNotifier
Manages beacon lifecycles and functions.
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_SCAN_INTERVAL
static long
DEFAULT_SCAN_PERIOD
static int
NOTIFICATION_ID
static java.lang.String
TAG
-
Constructor Summary
Constructors Constructor Description BeaconManager(android.content.Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
bindService(android.content.Intent intent, android.content.ServiceConnection serviceConnection, int i)
void
didDetermineStateForRegion(int i, org.altbeacon.beacon.Region region)
void
didEnterRegion(org.altbeacon.beacon.Region region)
void
didExitRegion(org.altbeacon.beacon.Region region)
void
didRangeBeaconsInRegion(java.util.Collection<org.altbeacon.beacon.Beacon> beacons, org.altbeacon.beacon.Region region)
android.content.Context
getApplicationContext()
void
onBeaconServiceConnect()
void
setBackgroundDurationScanPeriod(long backgroundScanDurationPeriod)
Set the background duration scan period.void
setBackgroundIntervalScanPeriod(long backgroundScanIntervalPeriod)
Set the background duration interval period.void
startMonitoring()
Intialize monitoring for detecting beacons.void
stopMonitoring()
Stop monitoring of beaconsvoid
unbindService(android.content.ServiceConnection serviceConnection)
-
-
-
Field Detail
-
TAG
public static final java.lang.String TAG
- See Also:
- Constant Field Values
-
DEFAULT_SCAN_INTERVAL
public static final long DEFAULT_SCAN_INTERVAL
- See Also:
- Constant Field Values
-
DEFAULT_SCAN_PERIOD
public static final long DEFAULT_SCAN_PERIOD
- See Also:
- Constant Field Values
-
NOTIFICATION_ID
public static final int NOTIFICATION_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
startMonitoring
public void startMonitoring()
Intialize monitoring for detecting beacons.
-
stopMonitoring
public void stopMonitoring()
Stop monitoring of beacons
-
setBackgroundIntervalScanPeriod
public void setBackgroundIntervalScanPeriod(long backgroundScanIntervalPeriod)
Set the background duration interval period. This overrides the default value 20000L in milliseconds.- Parameters:
backgroundScanIntervalPeriod
- interval for scanning beacon
-
setBackgroundDurationScanPeriod
public void setBackgroundDurationScanPeriod(long backgroundScanDurationPeriod)
Set the background duration scan period. This overrides the default value 1000L in milliseconds.- Parameters:
backgroundScanDurationPeriod
- duration on how long scanning will occur
-
didRangeBeaconsInRegion
public void didRangeBeaconsInRegion(java.util.Collection<org.altbeacon.beacon.Beacon> beacons, org.altbeacon.beacon.Region region)
- Specified by:
didRangeBeaconsInRegion
in interfaceorg.altbeacon.beacon.RangeNotifier
-
didEnterRegion
public void didEnterRegion(org.altbeacon.beacon.Region region)
- Specified by:
didEnterRegion
in interfaceorg.altbeacon.beacon.MonitorNotifier
-
didExitRegion
public void didExitRegion(org.altbeacon.beacon.Region region)
- Specified by:
didExitRegion
in interfaceorg.altbeacon.beacon.MonitorNotifier
-
didDetermineStateForRegion
public void didDetermineStateForRegion(int i, org.altbeacon.beacon.Region region)
- Specified by:
didDetermineStateForRegion
in interfaceorg.altbeacon.beacon.MonitorNotifier
-
onBeaconServiceConnect
public void onBeaconServiceConnect()
- Specified by:
onBeaconServiceConnect
in interfaceorg.altbeacon.beacon.BeaconConsumer
-
getApplicationContext
public android.content.Context getApplicationContext()
- Specified by:
getApplicationContext
in interfaceorg.altbeacon.beacon.BeaconConsumer
- Specified by:
getApplicationContext
in interfaceorg.altbeacon.beacon.startup.BootstrapNotifier
-
unbindService
public void unbindService(android.content.ServiceConnection serviceConnection)
- Specified by:
unbindService
in interfaceorg.altbeacon.beacon.BeaconConsumer
-
bindService
public boolean bindService(android.content.Intent intent, android.content.ServiceConnection serviceConnection, int i)
- Specified by:
bindService
in interfaceorg.altbeacon.beacon.BeaconConsumer
-
-