-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks
,android.content.ComponentCallbacks2
public class BeaconService extends Service
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
BeaconService.BeaconBinder
Class used for the client Binder. Because we know this service always runs in the same process as its clients, we don't need to deal with IPC.
-
Field Summary
Fields Modifier and Type Field Description public final static String
TAG
public final static int
MSG_START_RANGING
public final static int
MSG_STOP_RANGING
public final static int
MSG_START_MONITORING
public final static int
MSG_STOP_MONITORING
public final static int
MSG_SET_SCAN_PERIODS
public final static int
MSG_SYNC_SETTINGS
-
Method Summary
Modifier and Type Method Description void
onCreate()
int
onStartCommand(Intent intent, int flags, int startId)
IBinder
onBind(Intent intent)
When binding to the service, we return an interface to our messenger for sending messages to the service. boolean
onUnbind(Intent intent)
void
onDestroy()
void
onTaskRemoved(Intent rootIntent)
void
startRangingBeaconsInRegion(Region region, Callback callback)
methods for clients void
stopRangingBeaconsInRegion(Region region)
void
startMonitoringBeaconsInRegion(Region region, Callback callback)
void
stopMonitoringBeaconsInRegion(Region region)
void
setScanPeriods(long scanPeriod, long betweenScanPeriod, boolean backgroundFlag)
void
reloadParsers()
-
Methods inherited from class android.app.Service
getApplication, getForegroundServiceType, onConfigurationChanged, onLowMemory, onRebind, onStart, onTrimMemory, startForeground, stopForeground, stopSelf, stopSelfResult
-
Methods inherited from class android.content.ContextWrapper
bindIsolatedService, bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkSelfPermission, checkUriPermission, clearWallpaper, createAttributionContext, createConfigurationContext, createContextForSplit, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, createWindowContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getAttributionTag, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDataDir, getDatabasePath, getDir, getDisplay, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFileStreamPath, getFilesDir, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getResources, getSharedPreferences, getSystemService, getSystemServiceName, getTheme, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, peekWallpaper, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setTheme, setWallpaper, startActivities, startActivity, startForegroundService, startInstrumentation, startIntentSender, startService, stopService, unbindService, unregisterReceiver, updateServiceGroup
-
Methods inherited from class android.content.Context
getColor, getColorStateList, getDrawable, getString, getSystemService, getText, obtainStyledAttributes, registerComponentCallbacks, sendBroadcastWithMultiplePermissions, unregisterComponentCallbacks
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onCreate
@MainThread() void onCreate()
-
onStartCommand
int onStartCommand(Intent intent, int flags, int startId)
-
onBind
IBinder onBind(Intent intent)
When binding to the service, we return an interface to our messenger for sending messages to the service.
-
onDestroy
@MainThread() void onDestroy()
-
onTaskRemoved
void onTaskRemoved(Intent rootIntent)
-
startRangingBeaconsInRegion
@MainThread() void startRangingBeaconsInRegion(Region region, Callback callback)
methods for clients
-
stopRangingBeaconsInRegion
@MainThread() void stopRangingBeaconsInRegion(Region region)
-
startMonitoringBeaconsInRegion
@MainThread() void startMonitoringBeaconsInRegion(Region region, Callback callback)
-
stopMonitoringBeaconsInRegion
@MainThread() void stopMonitoringBeaconsInRegion(Region region)
-
setScanPeriods
@MainThread() void setScanPeriods(long scanPeriod, long betweenScanPeriod, boolean backgroundFlag)
-
reloadParsers
void reloadParsers()
-
-
-
-